Creating buttons that show based on members permission?

Hi All

Is it possible to use code to hide/show buttons/icons based on a members permissions?

For instance I have three levels of members (all free) that have different pages they can view I would like to hide the link button options they don’t have permission for so it looks cleaner and less confusing.

Hey
Yes, look here in the docs how to get roles and everything.
https://www.wix.com/code/reference/wix-users.html#currentUser

Should mention I am not that great with code so don’t have much of a clue how to put pieces of code together.

Hold on

Here you go, hope you can understand the code, if not Ask Question on the article page so we can make the article good enough for all.

https://uggadugg.wixanswers.com/en/article/showing-different-elements-depending-on-user-role

If you get it to work please mark my answer Top Comment as it helps me here in the forums.

Thank you, sorry how do i find out what my roles are as code, it doesn’t seem to be working at the moment.

Hej Andreas. Thanks for your comments on this. Unfortunately, the linked article is not available. Would you be able to provide the code? Many thanks