Skip Navigation

[Resolved] Show message to users with role < author

This support ticket is created 3 years 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by davidS-72 3 years ago.

Assisted by: Waqar.

Author
Posts
#2261279
Captura de pantalla 2022-01-07 214305.jpg

Hi!
I've a post form and I want to show the message "You don't have access" for users with role < author (only logged authors or greater can use this form).

I attach an image with my condition, but it doesn't works and show always the message.

thanks

#2262451
form-not-allowed-condition.png
form-allow-condition.png

Hi,

Thank you for contacting us and I'd be happy to assist.

Using the greater than evaluation won't work in this case and you'll have to join the conditional statements for each role, separately.

As shown in the screenshot "form-allow-condition", you'll see that the statements for the allowed user roles have been joined together using the "OR" operator, so that the form can be placed within this conditional block. As a result, the form will only show if the current user role is either administrator, editor, or author.

Likewise, as shown in the screenshot "form-not-allowed-condition", you can see that the "not" operator is checked with the same conditional statements as before, so that the "not allowed" message can be shown to users if they are not administrator, editor, or author.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2262829

Thanks It works. But, for the allow condition can I use "Post Forms Frontend Access" instead the if condition?

That is, if I use "Toolset acces control", the allow condition is necessary?

thanks

#2263441

Thanks for the update and glad that it works.

I shared the examples for both scenarios, to make the conditional usage more clear.

Your understanding is correct and if you're already using "Toolset access control", then the "allow" condition is not necessary.

#2263465

My issue is resolved now. Thank you!