Skip Navigation

[Resolved] Multiple roles

This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by stewartE 7 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#421795

Is it possible to assign more than one role to users. So...

By default ALL my users are subscribers. I want to create a Custom Role "A" which allows read and edit access to a group of pages. Subscribers CANNOT view or edit these pages. Can I assign Custom Role "A" to a set of users so that they are Subscribers AND Custom Role "A"

This means they have the same read all rights as Subscribers PLUS they can see the custom pages WHILE Subscribers have reads all rights EXCEPT they cannot see the custom pages

Or do i have to create a new role with the same permissions as Subscribes and add the additional permissions?

(hope that makes sense)

Thanks

#421847

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset natively does not support multiple roles per user as it's following WordPress standards.

1)
You can use [toolset_access] shortcode to display content role based.
=> https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/

For example:

[toolset_access role="subscriber,administrator" operator="allow"]
Content should be shown to roles Subscriber and Administrator
[/toolset_access]

2)
You can use View's [wpv-current-user] shortcode to get current logged in user information.

More info:
https://toolset.com/documentation/views-shortcodes/#wpv-current-user

Now, if you want to get current user role, you should use following code:

[wpv-current-user info="role"]

As you want to display custom fields based on specific role, you can use [wpv-confitional] shortcode.

For example - to check 'administrator" role:

[wpv–conditional if="( '[wpv-current-user info='role']' eq 'administrator' )"]
 
Display your custom fields for administrator role
 
[/wpv–conditional]

More info:
https://toolset.com/documentation/views-shortcodes/#wpv-conditional
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

3)
Finally - if #1 or #2 does not help:
You should try to find some plugins and play with that if that fits into your requirements:
=> https://wordpress.org/plugins/multiple-roles/
=> https://wordpress.org/plugins/multiple-roles-per-user/

#422096

Thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.