Skip Navigation

[Resolved] User unable to delete relationship on front end

This support ticket is created 5 years, 9 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 7 replies, has 2 voices.

Last updated by Minesh 5 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1219269

At present, there are two roles being used within my setup: Administrator and Contributor.

I have a view that shows the M2M relationship between a post type called Student and a post type called Route.

When logged in as an Administrator I am able to delete this relationship. But when logged in as a Contributor I am unable to delete the relationship. When I click the button nothing happens.

Here's the code from the View:

<td>[wpv-post-title]</td>
<td>[cred-delete-relationship role_items='$fromViews' relationship='route-and-student' redirect='self' type='button']Delete this route assignment[/cred-delete-relationship]</td>
#1219413

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - can you please share full page screenshot of your Edit view page?

#1219435
route assignment 1.jpeg
route assignment 2.jpeg
route assignment 3.jpeg

Screenshots attached, thanks Minesh 🙂

#1219528

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing the screenshots information.

Can you please go to:
=> Toolset => Access Control => Custom Roles
=> Click on the button "Enable Advanced Mode"
=> Go to "Contributor" role and click on the link "Change Permissions"
=> Within the "General Capabilities" activate manage_options Capability

Then check if Contributor user is able to delete the relationship on the frontend.

#1219926

Hi Minesh

That solution works on the front end.

Unfortunately, that solution also allows the user to access the backend, which is not acceptable.

Where to from here?

#1220400

Minesh
Supporter

Languages: English (English )

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

Ok - when you that it allows the access to the backend, the user obviously will have access to backend as I can see with the test site.

Can you be more specific what exactly you want to restrict on backend?

#1220456

Hi Minesh

I don't want any user aside from myself to have access to wp-admin.

The built-in WordPress roles aren't an essentialrequirement for me - I'm presently only using them to restrict the visibility of content using conditional tags. Would it help to make the users into Editors, for example?

#1220865

Minesh
Supporter

Languages: English (English )

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

Ok - for that you can use the number of plugin to restrict the admin access based on role or you should add some custom code that suits best as per your need/requirement.

Please check the following links that may help you:
=> https://wordpress.org/plugins/remove-dashboard-access-for-non-admins/
=> hidden link
=> hidden link
=> hidden link
=> https://wordpress.stackexchange.com/questions/66093/how-to-prevent-access-to-wp-admin-for-certain-user-roles
=> hidden link