Check this plugin. I’ve used it and it’s quite versatile regarding user roles and user capabilities.
You can also add conditional statements in your php files, like this:
if (!current_user_can('some_capability_you_added')) {
echo "You don't have permission for it!";
return;
}
You can output that sentence or nothing at all.
Related Posts:
- wp_update_user not updating
- Is WordPress’ is_user_logged_in() secure?
- Temporarily disable user role login and replace with message
- how to add custom user capabilities using add_user_meta or something else?
- Is there a way to set the user Role based on email domain
- pre_get_posts Remove posts based on meta value with ‘post__not_in’
- What is the difference between “create_users” and “add_users” capabilities?
- Access on specific pages in wordpress for a specific user
- How to ‘unpublish’ or ‘hide’ posts when user role changes?
- Hide Specific User Page
- Let new user role to ‘edit_others_posts’ of other user role, not of its own type
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- How do I remove the Other Roles field (from User Role Editor plugin) in wp-admin/user-new.php
- How to redirect specific post type with user role
- wordpress editor role remove all but ‘menus’ in appearance menu
- Parent User and Child User – relate users
- Subscriber (with read permissions) cannot view Private posts
- bbPress plugin moderator roles
- How to create user specific pages (not user role!)?
- Assigning certain authors to specific editors
- bbPress: How to set conditional for specific user -or- user role, to be displayed in user profile
- Restrict Access in Admin Panel
- Limit a user to have access to only specified pages?
- read_private_pages capability not working for new role
- Plugin creation – how to add user rights?
- User restricted only show posts assigned to current user
- Restrict custom post content to specific user
- Hide front-end from every logged out user and redirect them to the default login page
- How to restrict an admin page, if the user is not superadmin?
- How to create a front facing user sign up, log in and profile pages like FoodGawker.Com [closed]
- Custom Role read_private_posts Not Working
- Infinite redirects at front end if logged in user is not an Admin (Toolset Access)
- Is there a way to allow users with “Subscriber” user role to access media library in backend and frontend
- How to make WP page accessile only to specific user roles
- grant multiple roles access to specific admin menu item
- Check what capabilitie(s) an action requires
- Is it possible to restrict a specific user to edit a specific custom post.
- New folder and file permissions are not correct
- How to change user role setting in members plugin so that user can only edit his own post?
- How do I make a draft post accessible to everyone?
- Allow roles below admin to add subscribers only
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Hide Admin Menu for Specific User ID who has administrator Role
- Limit access to posts/pages by user roles
- How to force listing contributors in authors dropdown menu
- How do I allow a specific Role in WordPress 3+ to only see certain plugins?
- Allow editors access to added plugins
- Change role after the user has read all the posts in a category
- Do custom user roles have any default capabilities?
- Can i copy administrator role to another user?
- How to change role of all users with a specific role to another role?
- How to prevent users with “edit_others_posts” capability from editing admin posts
- How to let someone preview a draft?
- How can I allow user to select minimum privilege smartly
- Remove wordpress author’s capability to moderate comments on their own posts
- Contributor disable seeing others’ posts
- access the plugins for each role in WordPress multisite
- Listing child pages depending on user capability (role)
- Private page protected with username and password
- How do I display user name, role and site name using HTML tags inside a dashboard notification?
- Displaying different in-page content to cliente/admin
- User Role Capabilities for WordPress Gutenberg Blocks
- Iframe disappears when author updates page
- How to change a user’s role conditionally to expire after two weeks
- How to disallow participant from publishing topics(bbpress)?
- Stop users of author role from editing already pending posts
- Check role of Username then echo something if administrator [closed]
- Force modified contributor role to be re-approved on edit?
- Stop contributors from editing standard posts but allow them to edit a custom post type
- How to hide a HTML element based on user role
- create new user role for reader
- Hide Users by user role in Worpress
- Want to know parameters that can be passed to user_can() for access control by user capabilities
- Change user role of a particular user at specific time
- Restrict access to a post once it is tagged as a given status
- List of users with email and role
- Subscription list function
- Using my own user table
- Common user login for two different wordpress installation and bbpress
- User role editor – Add download files capability
- Error while creating a clone role in wordpress
- Change auth_cookie_expiration for specific roles and specific login times
- Set user role, if an specific role created an user
- Allow user to select role from front end edit profile form
- Custom user roles are unable to login
- Restrict Author to post only to a specific category
- How to show only specific category post by user role without plugin and restrict all other cats
- TCPDF only exports .pdf when user is administrator
- Custom User Role – can’t edit or publish pages?
- Dropdown of user roles that depend on variable
- How do you make a custom post type invisible for subscribers
- Add role selector to custom registration page
- How can I remove “Add new” button on custom post type
- Why does user_can return false for a capability during plugin deactivation?
- Removing Admin Bar Node Based on Role
- Create an email address that forwards to users in role
- How to update user role totals
- Restrict Access to the User Profile
- update_user_meta on registration but only for default role type
- Role Scoper, don’t allow other users to see pending posts