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:=@Implode(@UserAccess(@DbName));
aclvalue1:=@TextToNumber(@Left(accesslevel;1));
aclvalue2:=@TextToNumber(@Middle(accesslevel;2;1));
aclvalue3:=@TextToNumber(@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:=@Implode(@UserAccess(@DbName));
aclvalue1:=@TextToNumber(@Left(accesslevel;1));
aclvalue2:=@TextToNumber(@Middle(accesslevel;2;1));
aclvalue3:=@TextToNumber(@Right(accesslevel;2));

textaclvalue:=@If(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+"
("+@Text(aclvalue1)+") access to this database.");
@Prompt([OK];"Create Documents Access";"Your ability to create documents is
"+@Text(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
"+@Text(aclvalue3)+". One means you can remove documents, zero means you can
not remove documents from this database.")

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close