Jump to content
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 5

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

I don't think that one should need additional software, just to copy and use code from this forum.

  • Like 1

Share this post


Link to post
Share on other sites

I have the exact same problem.
I have a page ref field for user selection, and no role, but the superuser, can find users.
Under »Input« I have »Users« withing the »Parent« section of »Selectable Pages«,
and a »custom find« to to the special role gives no entries for the logged in user (as OP) (Roles Name Equals Reseller | @roles.name=reseller | it matches 10 pages.)
Is check_access the solution for this, and how would I implement it within the page field?

thx

Share this post


Link to post
Share on other sites
43 minutes ago, ocr_b said:

Is check_access the solution for this, and how would I implement it within the page field?

In your custom find, choose Custom (field=value) and enter check_access=0 in the far right column.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

I can confirm that this fixed the problem for me, when I typed check_access=0 by hand into the selector field instead of copying and pasting it from Adrian's message. Thank you @adrian, for identifying the solution! And thank you, @Robin S for figuring out where I went wrong!

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
16 hours ago, adrian said:

In your custom find, choose Custom (field=value) and enter check_access=0 in the far right column.

331225368_Screenshot2019-03-2009_16_00.thumb.jpg.19593794593e88d6ee7e010fe25ce577.jpg

SQL Error?
Solved by making my own selector string.

Can you also explain a bit this a bit deeper? From the docs:
»Include pages that user doesn't have access to view.«
— Why is the user not having access to the pages even though it has user-admin permissions?
— How is it possible to give the user the rights to see the pages without check_access?

Thanks!

Share this post


Link to post
Share on other sites

I'd like to understand this too. I too made sure that the editor role had user-admin permissions enabled, before coming across this problem.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...