Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Retrict Access to Menu Items by Role
Tagged: frontend, menu, user roles
- This topic has 6 replies, 4 voices, and was last updated 9 years, 5 months ago by Vladimir.
-
AuthorPosts
-
03/04/2014 at 01:49 #605wibwradioSpectator
It would be nice if I could restrict access to menu items by role.
03/04/2014 at 02:44 #606VladimirKeymasterThanks. I have this idea in the development plan and hope to offer such functionality to user of Pro version in 1-2 months.
If you familiar with PHP you may realize it using customized code from these posts:
https://role-editor.com/allow-access-appearance-menu-items/
https://role-editor.com/restrict-access-wordpress-widgets-area/23/04/2014 at 01:36 #643VladimirKeymasterVersion 4.12 contains new Admin menu access module, which allows to block menu items for selected role
https://role-editor.com/block-admin-menu-items/25/06/2014 at 10:43 #738neocreoSpectatorIs there a similar way to block certain user groups from particular menu items in the front-end?
For instance I have clients and co workers and want certain menu items such as “reports” not accessible by clients.
Sure, I can limit the access to the page, but it would be even more reasonable that if a user hasn’t got access – they won’t see the menu option at all.
12/06/2015 at 21:14 #1534Tom TownsendParticipantI am trying to figure out the best way to limit access to Job Manager by roles.
Recruiter:
I set up a recruiter role and allow them to only access the Job Manager plugin specific Menu Items:
Add Job, Jobs , Applications, Emails and Interviews
and the Media Browser …Senior Recruiter:
Would have access to all the above as wells the Settings area where the could modify the templates.
I don’t see how I can do this in Custom capabilities. I am sure it’s just my lack of understanding how to register that capability.
IS there a tutorial somewhere you can point me to ?
Thanks
12/06/2015 at 21:52 #1535Tom TownsendParticipantOk, figured it out – just need to look around the site for info.
Found that if i use the Admin Menu I can clone an Admin User – Add a new role called Sr. Recruiter – then limit the access from there.
Excellent….plugin…
13/06/2015 at 02:47 #1537VladimirKeymasterThanks, Tom.
It’s quite right decision when you can not input changes into the plugin source code – plugin author does not agree to apply suggested changes, for example.
As you take decisions yourself, you may take into account another model – use your own custom user capabilities to protect ‘Job Manager’ plugin menu items. For example, some times site owner may wish to give to the user access to the “Job Manager->Settings”, but he does not wish to give him access to the full “WordPress->Settings” menu. When plugins uses “manage_options” site owner should use URE Pro “Admin menu access” add-on or an alternative decision. If you use your own user capability, e.g. ‘job_man_manage_options’ it will simplifies the things. This way site owner will may manage access to this menu item directly via add/remove capability to the role.
You need to add your own custom capabilities automatically to the “Administrator” role during plugin activation of course.
-
AuthorPosts
- You must be logged in to reply to this topic.