Either you want to control in the button code that the user does have the proper role, or you want to hide the button to those who do not have it.
Assuming you are using formula language (script is a bit harder), then in both cases, you control the role with this :
Code:
@Contains(@userRoles;[i]rolename[/i])
I know many people will prefer using @Member, but I find @Contains acts better and more consistently.
So, how to use this ?
If you want to control in the button code, then the very first line should be like this :
Code:
@if(!@Contains(@userRoles;[i]rolename[/i]);@Failure("");"")
So you check if the user does not have the role, in which case the code ends. If he does, the condition does nothing (the empty quotes) and the code continues.
If you prefer to hide the button entirely (my preferred option, if you can't see it, you get less user calls about it), then you need to edit the text properties of the button and use the hide-when option. Type the first formula with the NOT operator, and you should be done.
OK ?
Pascal.