Posted: December 6, 2016 at 3:36 am
|
Hi there, I need your help. The given wordpress/EE rights are not enough to hide some crucial elements that certain user roles are not allowed to see. In particular, the values entered by an attende can be seen in the registration event detail under the Registration Form Answers. These Answer contain critical data that an Event Manager for example is not allowed to see. Unfortunately, the give rights management does not allow me to hide those elements for the event manager. Do you have any smart ideas of how to solve that problem? Thanks for your help. |
|
No response? |
|
Could you at least give me a hint of where the HTML for those parts is generated (in which EE files) so I can hack it temporarily and hide it based on wp-roles? |
Hi there, Just to note, ‘bumping’ your threads effectively puts them to the back of the queue as we try to answer threads based on reply date (although not always) So you want the event admins to be able to edit registrations made on their events, but not view the registration questions? There is more to the EE capability system than the cap check which allows for what you are requesting, however it will take some coding on your part to set up. Take a look here: https://github.com/eventespresso/event-espresso-core/blob/master/docs/K–Capability-System/ee-capability-system-overview.md Paying particular attention to ‘contexts’ as it allows you to filter certain sections based on the capability AND context. So…
That metabox has and ID of ‘edit-reg-questions-mbox’ so if we search the EE codebase for how that metabox is added we’ll find:
So that metabox relies on the So you have 2 options, you can remove the OR You can filter the above check, within the current context and remove the metabox from view. The link above explains how to do that, but we can run through this example to show you a little more: https://gist.github.com/Pebblo/f0c2ab5e0295f7eca8e463f087ccf9e8 That code runs on a dynamic filter for the context, checks for the current capability (and if the current user can manage_options) and if not removes the meta box, whilst still allowing the user to have the ee_edit_registrations capability. For the CSV you can do something similar using this the example functions we have to limit the CSV out: Use a
We do not support hacking core files, so will not provide a list files you should edit to achieve specific features although we are more than happy to add additional hooks within EE should they be needed. |
|
The support post ‘Super granular user rights’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.