Skip Navigation

[Resolved] [toolset_access] shortcode doesn’t work when user has multiple roles

This thread is resolved. Here is a description of the problem and solution.

Problem:
The toolset_access shortcode is used to restrict content within a page or post based upon roles, but doesn't work when a user has multiple roles.

Solution:
Support for multiple roles is being added and will be included in the next version of Access, which is currently in testing.

This support ticket is created 5 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Mukesh 5 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#1204139

I am trying to:
I am using the [toolset_access] short code in many of our Pages, to restrict Views to certain Roles. I am using a 3rd party plugin to assign Multiple Roles to a Single User. However when the user with those multiple roles logs into the site and goes to the page, the views output is not there. If I remove the [toolset_access] shortcode surrounding the view, then the view loads fine. THe view loads fine for users that are assigned to just one role.

Here is sameple code from the page:
<div id="tab2" class="tab-pane fade">
<div class="panel panel-default">
<div class="panel-heading">Panel Description goes there</div>
<p>[toolset_access role="Administrator,Office Team 6" operator="allow"][wpv-view name="bucket-7-doctor-not-available-list" cached="off" viewname="doctor"][/toolset_access]</div>
</div>

I expected to see: I expected to have the view output rendered even if the User is assigned multiple Roles. Again this code works fine when a user is either single role.

Instead, I got:

#1204297

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Mukesh

Access currently does not support multiple roles.

However, support is being added.

There is a fairly major release of Access that is expected within a couple of weeks or so, depending on testing, and it will contain initial support for multiple roles. Keep an eye out for the update.

#1204832

Thanks Nigel. I'll look out for the update.