johnstephens

Permissions for "Page Reference" field linked to "Users"

Recommended Posts

Hi!

I created a page reference field linked to ProcessWire's "Users" page array. I do not have "create new pages" enabled for the field, and I don't want to use this field to create new users.

When I am logged in as the superuser, it works as intended: I can select one or more registered users and associate them with the current page.

But when I log in under a different role, the page reference field is empty, and does not allow me to select any users.

I've checked the permissions for the role that I want to authorize to use the this field, and the permissions under the "Access" tab on the field itself. I don't see any role-based permissions I could add to the role that seem pertinent to this issue. Under the field's "Access" tab, I have added "View" and "Edit" privileges for the given role, but that does not seem to change the behavior at all.

Can anyone offer some guidance in troubleshooting this? I know there must be some privileges I have not considered, but I don't know where to look.

Thank you all in advance!

Share this post


Link to post
Share on other sites

Try adding check_access=0 to the selector.

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you, @adrian!

That seems to cause ProcessWire to choke when loading a page in the editor.

If I set the selector to this:

template=user, roles=managing_editor

It works perfectly for a superuser. The above selector throws no error when loading the editor using my managing_editor role—it simply doesn't populate the options.

But if I set the selector to this:

template=user, roles=managing_editor, check_access=0

ProcessWire throws this error, no matter what role I log in with:
Unknown Selector operator: '' -- was your selector value properly escaped?

Thanks again! I appreciate any insight someone might offer. Cheers!

Share this post


Link to post
Share on other sites

Just a wild guess, but try to add $config->advanced = true; to your site/config.php file

Share this post


Link to post
Share on other sites
On 2/14/2019 at 10:36 AM, johnstephens said:

But if I set the selector to this:


template=user, roles=managing_editor, check_access=0

ProcessWire throws this error, no matter what role I log in with

This kind of selector is working for me with superuser and non-superuser roles.

Did you type the "check_access=0" into the selector string by hand or did you copy/paste from @adrian's post? Because I'm seeing non-printable characters when pasting from the post:

2019-02-15_153910.png.459a140e0efe8cac511ad6314a3b446b.png

@Pete, this non-printable character issue is getting quite bad in the forums lately and can cause a lot of confusion. I don't understand how these characters are creeping into posts seeing as I'm sure nobody is entering them deliberately. Do you know if anything can be done to avoid this issue?

  • Like 3

Share this post


Link to post
Share on other sites
13 hours ago, Robin S said:

copy/paste from @adrian's post?

I recommend using tools like:

For Plain Clip.app and similar one can setup a global shortcut launching some simple custom made script – I use the commercial Keyboard Maestro but there should be free alternatives out there – so that one can easily paste clean text no matter what the source is.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.