Accessing/Reading members of a group within the ACL

Hi guys,

I have a form with an ‘Approve’ button. I want this button to hide if the person signed in is not a member of the group ‘Approvers.’ This groups is declared within the ACL.

I have tried the following and was unsuccessful:

@IsMember(“[Approvers]”;@UserRoles)

Any suggestions?

Was think could something like this work:

@UserName @IsNotMember(“[Approvers]”;@UserRoles)

Subject: Accessing/Reading members of a group within the ACL.

If Approvers is a group then try

!@Contains(@UserNamesList; “Approvers”) or

!@IsMember(“Approvers”; @UserNamesList) or

create an Approvers role in the ACL and assign it to the Approvers group and then your original formula should work.

Subject: RE: Accessing/Reading members of a group within the ACL.

Hi Paul,

Tried your method and works as expected.

One question, why has Andre suggested not to use @Contains?

Subject: RE: Accessing/Reading members of a group within the ACL.

not exactly sure why but he’s a smart guy and has likely had a bad experience with it so maybe use !@IsMember instead, as he suggests

Subject: RE: Accessing/Reading members of a group within the ACL.

You seem to be confusing groups and roles. Did you create a role called Approvers in the database ACL, or is it actually an address book group (if the latter, not a very good name choice!)?Is this taking place in a server or local replica? If a local replica, is the “Enforce a consistent access control list” option enabled?

Often, you must close and reopen the application to get role membership changes to take effect.

I have a custom toolbar button defined with the following formula:

@Prompt([ok]; “My Roles”; @Implode(@UserRoles; ", "))

so that I can see what my Notes client thinks my current roles are in a database. Always check your inputs. The best formula in the world will not work correctly if you give it the wrong data to work on.

Do not use @Contains as others have suggested. @IsMember or = is the correct choice. You don’t want to search for substrings.

Subject: RE: Accessing/Reading members of a group within the ACL.

Hi Andre,

Thanks for the information, very useful.

I have used the @Contains and works as expected. I have also used the @IsMember and that works too.

Why do you advise not to use the @Contains?

Subject: RE: Accessing/Reading members of a group within the ACL.

@contains is for strings where @ismember is for lists.

Here is a bit more details:

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/fcc37758dc15ddb3852572dd0055a1a7?OpenDocument

So one example not using list:

@Contains(“My Computer should allow people with the roles [Admin][DBManager]”;“[Admin]” is true

@IsMember(“My Computer should allow people with the roles [Admin][DBManager]”;“[Admin]” is false

Subject: Accessing/Reading members of a group within the ACL.

I use @Contains

Maybe something like (don’t need the brackets):

@Contains(@UserRoles; “Approvers”);

HTH,

Dan