Skip Navigation

[Resolved] CRED delete link not working when not logged in as administrator

This support ticket is created 5 years, 2 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by roulartaM 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1384309
custom-role-permissions.png
partner-with-brands.png
relationship.png

Hi there!

I have a many to many relationship between CPT 'partners' and CPT 'brands' (NL = 'merken'). The relationship is called 'brans-shop' (see 'relationship.png'). Via CRED, a partner can log in and edit his fields, e.g. 'name', 'address', 'photo', ... Every partner has a custom role called 'Partner' assigned. Only 2 permissions of that 'Partner' custom role are checked:

- level_0 (Other capabilities)
- read (Other capabilities)

Once logged in, the partner should be able to add and remove multiple brands. So I've made a view (called 'Klanteninterface: merken (per winkel)') that loops all the brands related to that partner:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div>[wpv-post-title] ([cred-delete-relationship role_items='$fromViews' relationship='brans-shop' redirect='self']Delete[/cred-delete-relationship])</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No brands found.[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

(see 'partner-with-brands.png')

Adding a new brand works great, the problem I'm dealing with is when I want to delete a brand relation.
It works fine when I'm logged in as an administrator, but clicking the 'delete' link (NL = 'Verwijderen') isn't working when I'm logged in as a partner (so when I have the 'Partner'-role.

Clicking the link doesn't do anything. No loading page, no loading cursor: no changes at all! It must be a user rights problem, but I can't find how I can solve it. I've checked every permission in the custom user roles but I'm not sure if there's an option that I should check so a partner could delete his brands (see 'custom-role-permissions.png').

Perhaps you guys know what I could do to fix my problem?

#1384343

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

I see you say your Partner role only has 2 permissions, however they will need Delete permissions for this post type in order for them to be able to delete it.

Is this post type being managed by access ? Please check that the user role is able to delete the post.

Thanks,
Shane

#1386813

Thanks for pointing me in the right direction. I finally found the right permission (Access control > Custom roles > Change permissions) to check: 'manage_options'.
I did some additional tests and concluded that the specific post type 'Partner' don't need the 'Delete own' checked 😉