Manage Learn to apply best practices and optimize your operations.

Using Userroles To Hide/Show Buttons

Using the @UserRoles function, you can make your forms look a lot cleaner by
hiding action buttons not available to all application users.

For example, if most of your users have only Reader access to the database, why
would you want them to see the Edit Document Action?

The first formula example shows you how to accomplish this task without
resorting to roles. The second formula example is an easy way to show ACL
values.
Example 1: Used to show Edit Document button only when user has appropriate
access. Listed in the Hide-When tab of the Action method on a form.

accesslevel:[email protected](@UserAccess(@DbName));
aclvalue1:[email protected](@Left(accesslevel;1));
aclvalue2:[email protected](@Middle(accesslevel;2;1));
aclvalue3:[email protected](@Right(accesslevel;2));

@If(aclvalue1>3&aclvalue2>0;@False;@True)

Example 2: Formula to show end-user their level of access to the database.

accesslevel:[email protected](@UserAccess(@DbName));
aclvalue1:[email protected](@Left(accesslevel;1));
aclvalue2:[email protected](@Middle(accesslevel;2;1));
aclvalue3:[email protected](@Right(accesslevel;2));

textaclvalue:[email protected](aclvalue1=1;"Depositor";
aclvalue1=2;"Reader";
aclvalue1=3;"Author";
aclvalue1=4;"Editor";
aclvalue1=5;"Designer";
aclvalue1=6;"Manager";"Error!");

@Prompt([OK];"Standard Access";"You have "+textaclvalue+"
("[email protected](aclvalue1)+") access to this database.");
@Prompt([OK];"Create Documents Access";"Your ability to create documents is
"[email protected](aclvalue2)+". One means you can create documents, zero means you can
not create documents in this database.");
@Prompt([OK];"Delete Documents Access";"Your ability to delete documents is
"[email protected](aclvalue3)+". One means you can remove documents, zero means you can
not remove documents from this database.")

Dig Deeper on Domino Resources - Part 7

SearchWindowsServer
Search400
  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

SearchDataCenter
SearchContentManagement
Close