Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Domino Design Question

Status
Not open for further replies.

TomLon

Technical User
Jul 19, 2002
48
US
Not sure if I am in the right location. I have a form with a RadioButton called QA-Init. I am wanting to limit changes/clicks to this button(s) to just users in the QA-OFFC role. I have the role setup in my ACL and users assigned to this role. But How do I go about limiting changes to this control. If a person is not assigned to that role, I would like a message to display and the control value to not change.

Thanks
 
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.
 
Thanks. As you can tell, I am fairly green in Domino Development. This code, I am assuming would go in the OnClick of my control if I wish control by code? However, when I select OnClick, I cannot change from JavaScript to Formula in my programming pane. I thought that I could in the past. Again, thanks.
 
You have Java code in there ?
Forget the code control, use Hide/When. It's safer.

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top