-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Short description of the issue
Using ProcessWire’s $config->userTemplateIDs
and $config->userPageIDs
feature, when requesting their own front-end page for viewing, logged-in users are denied and redirected according to the template’s configured “what to do when user has no access” option, unless they have the permissions user-admin or profile-edit. This happens even though the user’s template specifically defines view (but not edit) access for their role.
Expected behavior
Users should be able to view pages whose template is configured to let them do so, regardless of missing edit or admin permissions, even if the page is instanceof User.
Actual behavior
User pages are only viewable to users with edit or admin permission.
Optional: Suggestion for a possible fix
I have submitted a small fix here: processwire/processwire#162. I might have missed some cases or screwed up otherwise. My experience with PW’s internals is pretty limited ;)
Steps to reproduce the issue
My setup is somewhat old and was originally built with PW 2.x, but this probably still works.
- Set up custom users according to this post.
- Enable “manage view and edit access” in the new user template settings.
- Create a role for your new user type.
- Give that role the permission
page-view
for the user template, but no edit, admin or backend permissions. - Create a user of your custom type
- Log in as that user and view the user page (
$page->url
, not$page->editUrl
) - You should get a 404 although you seem to have all necessary permissions
ProcessWire version: 3.0.148