Jump to content
nurkka

[Solved] Select options field: options won't save with custom user role

Recommended Posts

Hi,

I'm maintaining a multilanguage website where two different design companies have access to the processwire backend. For one of the teams I created a custom user role called "designadmin", where I activated the permissions "field-admin" and "template-admin", so the designers are able to edit fields and templates. This worked very well, but now, they wanted to create a select options field, and then change the values of the options. When clicking "Save" in the ProcessWire backend, the changed values won't save and are immediately restored to their previous values. Screenshot:

image.png.37d6212ec55ca548f641fe8438a94454.png

When logging in as superuser, these values can be changed and saved successfully.

How can I give the design team the permission to change and save options values, without giving them superuser access?

Thank you for your help!

 

Share this post


Link to post
Share on other sites

You should check first if this is really a permission issue or something else.

Enable Tracy Debugger's user switcher, and then switch to one of those agency accounts and try to reproduce that behavior. Check the browser console for errors, and of course if Tracy is reporting anything.

  • Thanks 1

Share this post


Link to post
Share on other sites

You could change your Select Options fields to Page Reference fields. Page Reference fields are more powerful and flexible and the better choice in most cases. One of the advantages is that users can edit, sort, add and remove options for fields simply by working with the pages that represent the options.

You can create a References branch in your page tree to hold the option pages for your Page Reference fields, and the Page Field Select Creator module is useful for quickly setting up new fields.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you both! In the meantime I have found the corresponding line of code in the FieldtypeOptions module. Before saving the options, ProcessWire checks, if the current user is a superuser. So any non superusers cannot save option values (in the current / newest ProcessWire version 3.0.148). So I modified the corresponding if statement, in order to allow users with "field-admin" permission.

Thanks again for your suggestions. I took the opportunity to take a closer look at Tracy Debugger and I will definitely keep the page field select module in mind.

  • Like 1

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...