Forum
Example auth plugin gives missing Collections and Routes nav items
Hi, I've followed the instructions at https://docs.grabaperch.com/api/auth/ for an authentication plugin, and have the code the same as on this page.
I can use the Perch admin without logging in, but the Collections, Routes and Users navigation items are missing. I tried the email addresses as one of the registered admins but get the same result. Is this intended?
Thanks
Does the role you're logging in as have permission to access those?
Users obviously doesn't apply if you're managing the logins.
I think so -I've got
'role' => 'admin'
and the email address as an admin account. When I log in with this email address normally I get the Collections and Routes nav items.Ok, I'll check what's happening.
Cool thanks. Were you able to recreate this?
I've not had the chance yet, but I'll see if I can look at it today.
No worries, thanks.
Ok, found and fixed. There's a bug with how the special 'admin' role's privileges are escalated when using an auth plugin.
The workaround for the time being is to create a role with all privileges assigned, rather than relying on the
admin
role.This is fixed for Perch/Runway 3.
I've created a role called
loggedin
and assigned it all privileges, and used it for the value ofrole
inauth.php
-in bothlog_user_in()
andresume_session()
, but I still get the same UI as I had when using theadmin
role.Do you see privileges for those items in the control panel?
Oh yes I forgot to mention -I don't see any options relating to collections (or routes) in the Roles page, but do see checkboxes for System, Assets, Categories and Pages. In case helpful, I do see a
FROM perch2_gacdcollections
query in the debug message section.Is
gacdcollections
a custom app?Must be just the test collection I created.
Collections don't have their own tables, so that doesn't seem likely.
Oh right. Under the Apps menu there's "Categories" and the name of the collection I created. I've not installed/made any custom apps.
Ok, that sounds odd. I don't think it's related. It sounds like you're missing some privileges in your database.
Was this a clean install of 2.8.34 or an update from an earlier version?
Perch Runway 2.8.34, fresh install. I didn't run the usual setup, rather my colleague made a very simple site, and a user account for me, and dumped the DB. He committed the whole site folder to source control, including the dump, so my DB is made from the dump. Might that make any difference?
No, that shouldn't make any difference. I'll take a look into it. It may be that the best option is to wait for Runway 3.
Okay thanks. I'm sure you get asked this every five mins, but what kind of time scale for release of v3?
Very soon - so much so that I'm fixing bugs in v3 not v2 right now.
Cool :)