Roles problem

hi all

i have four roles

“[Sales]”:

“[Service]”

“[Marketing]”

“[Content]”;

i want to give permission to people who will have any of these roles

for one role it si working

rem is not working…

code is

this is for all roles which is not working

@If(!@IsMember(“[Sales]”:“[Service]”:“[Marketing]”:“[Content]”;@UserRoles))

this is working…

@If(!@IsMember("[Sales;@UserRoles))

Subject: roles problem …

Don’t use @IsMember. Use the permuted equality check instead.

@UserRoles *= “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”

… will be true if the user has any one of the four roles.

!(@UserRoles *= “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”)

… will be true if the user has none of the four roles.

@UserRoles *<> “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”

… will be true if the user is missing any one of the roles.

!(@UserRoles *<> “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”)

… will be true if the user has all four roles.

Subject: roles problem … (correction)

@UserRoles *<> “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”> … will be true if the user is missing any one of the roles.

Unfortunately, no. Try this in a button:

_t := (“a”:“b”) *<> (“a”:“b”);

@StatusBar(@Text(_t))

It prints “1”. That’s because “a” (from the first list) isn’t equal to “b” (from the second list). The *<> operator is really pretty useless, I’m afraid.

For this test, you really do have to use @IsMember.

Subject: roles problem …

I think you have your @isMember backwords you want to see if the person has any of the roles in the list.

@IsMember( @UserRole; “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”)

So ultimately you could write:

@If( @IsNotMember( @UserRoles; “[Sales]”:“[Service]”:“[Marketing]”:“[Content]”) )