I has the following formula:
view := “Menu Control Handler”;
key := “Menu Control Handler”;
FIELD AllowedPerson := @DbColumn(“”:“NoCache”;“”:“”;view;2);
FIELD AllowedRole := @DbColumn(“”:“NoCache”;“”:“”;view;3);
FIELD ExceptPerson := @DbColumn(“”:“NoCache”;“”:“”;view;4);
FIELD ExceptRole := @DbColumn(“”:“NoCache”;“”:“”;view;5);
FIELD Enable := @DbColumn(“”:“NoCache”;“”:“”;view;6);
@For(i:=1;i<=50;i:=i+1;FIELD Result := @If(i=1;@If((@IsMember(@UserName;@Explode(ExceptPerson[i];“,”)) & ExceptPerson[i] !=“”) | (@IsMember(@Explode(@UserRoles;“,”);@Explode(ExceptRole[i];“,”)) & ExceptRole[i] !=“”);“Not Show”;(@IsMember(@UserName;@Explode(AllowedPerson[i];“,”)) & AllowedPerson[i] !=“”) | (@IsMember(@Explode(@UserRoles;“,”);@Explode(AllowedRole[i];“,”)) & AllowedRole[i] !=“”);“Show”;@If(AllowedPerson[i] =“” & AllowedRole[i] =“” & ExceptPerson[i] =“” & ExceptRole[i] =“” & Enable[i] =“Disable”;“Show”; “Not Show”));Result : @If((@IsMember(@UserName;@Explode(ExceptPerson[i];“,”)) & ExceptPerson[i] !=“”) | (@IsMember(@Explode(@UserRoles;“,”);@Explode(ExceptRole[i];“,”)) & ExceptRole[i] !=“”);“Not Show”;(@IsMember(@UserName;@Explode(AllowedPerson[i];“,”)) & AllowedPerson[i] !=“”) | (@IsMember(@Explode(@UserRoles;“,”);@Explode(AllowedRole[i];“,”)) & AllowedRole[i] !=“”);“Show”;@If(AllowedPerson[i] =“” & AllowedRole[i] =“” & ExceptPerson[i] =“” & ExceptRole[i] =“” & Enable[i] =“Disable” ;“Show”; “Not Show”))));
Result
I want to hide the outline menu with the above fomrula, I has a document to stored the access right, however, it do not work when @UserRoles is multiple value.
I tried to such that for testing:
@Prompt([OK];“Title”;“User Roles=”+@UserRoles+“Roles=”+@Explode(@Implode(AllowedRole[1]))+“Result=”+@Keywords(@UserRoles;@Explode(@Implode(AllowedRole[1]))))
For example:
AllowedRoles contain [Finance], [Finance Manager]
and my ACL Roles are [Finance], [Admin], [Developer]
where AllowedRole[1] is multi-value and stored with and @UserRoles is also multi-value, how can I test my current roles is exist in the field AllowedRole (multi-value)?