API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
Section Access With Roles
In a controlled access section, in order to have access you must be listed in the list of names that has access to that section. The list of names can be hard-coded or computed, but it must be a list of names. So what if you have access to your database controlled through roles and would like to do the same for the section?

Well, you will have to have your formula compute a list of names and then if you, personally, are a member of that list of names then you will have access. That "list" of names could really just be one name. In order to get that one name, use the following formula in your controlled access section:

@If(@IsMember("[RoleName]"; @UserRoles); @UserName; "Nobody")

Note: "[RoleName]" should be substituted with the name of your role. "Nobody" is any string except the user's name.

This will see if the user currently opening the document is a member of the given role. If they are, the controlled section access "list" of editors is the current user. The current user (obviously) matches the current user and they have access to the section. If they are not in the role, the controlly section access "list" is the string "Nobody" which doesn't match the current user (we hope) and prevents access to the section.