Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author uamv

    (@uamv)

    So, you would like to setup default glances for users, then restrict them from modifying these? Currently, that is not an option, but sounds like a reasonable feature request. I’ll try to remember that for the next version.

    Thread Starter MulderDSM

    (@mulderdsm)

    Great! Thanks!

    Plugin Author uamv

    (@uamv)

    As of v2.3, you can restrict modification via the constant:

    define( 'GT_EDIT_GLANCES', 'capability_required_to_edit' );

    Hopefully, I didn’t break anything. I hope you’re able to make good use of the plugin and would appreciate a review if you have a moment.

    Thread Starter MulderDSM

    (@mulderdsm)

    Hmm. It’s probably something I’m doing wrong, but I manage roles using White Label Branding plugin. I added this capability, it now shows up as an option. On the Admin I have it checked and on the Editor role, I have it unchecked. However when I log in as an Editor they still have the Add/Remove Item link and the options I set up to show new custom post types doesn’t appear on the Editor’s at a glance unless i need to add it to that user’s at a glance and then not allow them to change it.

    Plugin Author uamv

    (@uamv)

    I may have been a bit vague in my documentation, but ‘capability_required_to_edit’ is not a capability you will add to any user.

    First, select a capability to which you would like to restrict editing of glances. This could be done by using an existing capability or creating a new one via your role management plugin. Let’s say (with native roles) you want to restrict editing of glances to administrators or editors, then you could select a capability such as ‘edit_others_pages’. Alternatively, you could assign the capability of ‘edit_glances’ to a specific role.

    Secondly, after a role holds the capability, you will restrict editing to that role only by defining the above constant in wp-config.php, replacing 'capability_required_to_edit' with the specific capability you are using for this restriction.

    Now, only users with a role possessing that capability will be able to edit their own glances.

    Default glances for a user can be set by using the gt_default_glances filter. However, once a user visits their dashboard with the plugin active, a set of glances will be written to the database. After that happens, any edits to their glances would need to happen via their account, as the filter only sets the defaults on the first visit.

    Hope that clarifies things a bit. Let me know if I can assist further.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can you add or hide per user role or capability?’ is closed to new replies.