Hi Readers,
I have created a record as below, and there are 9 users using the application, and there are 3 groups
For supposeusers are: u1, u2, u3, u4, u5, u6, u7, u8, u9Groups: All users, Administrators, App1Users, App2Users
All users group is a parent group.
Users in App1Users group are: u1, u2, u3, u4, Users in App2Users group are: u5, u6, u7Users in Administrators group are: u8 and u9
Use case: When users u8 or u9 login They should be able to see all the records entered by all members who are using the application.When users u5 or u6 or u7 login and see the records they should be able to see only the records which are entered by their group membersWhen users u1 or u2 or u3 or u4 login and see the records they should be able to see only the records which are entered by their group members
What i tried: I have used loggedinuser() function it helped me see the records entered only by the logged in user only; i failed to write an exception in the filter as i am not sure weather we can do that or not
Would like to know if we can do that use case if yes how, and would like to know if any exception can be created for filters created if yes how ??
and also would like to know what operation need to be used to check weather a name is present in list of names -- Includes and In did not work:(
Discussion posts and replies are publicly visible
Which Appian version are you working with? With 22.1 and the new record security rules, this should be pretty straight forward.
I am using appian 21.4
OK. Store the group id of the creating user in the record. Then you default filter should look like this. (No real code here)
if user is member of admin:
{} /* No filter */
if user is member of group1:
{filter for group1}
if user is member of group2:
{filter for group2}
else:
{} /* Not filter */
Make sure to define record security to only allow access to required groups.
Its working well, but when trying to filter for a group i am using in operator hence getting some error, help me in resolving this a!queryFilter( field: 'recordType!{38925ecc-73bf-4eda-81a5-6dd53f0404bd}WNA Audit.fields.{7c7be218-5b7c-46b6-b430-078a2fb70c7b}Name', operator: "in", value: a!groupMembers( group: a!groupsByName("WNA Application Users") ).data
error
By "filter for group" I meant to filter for the group itself, not the members.
But so solve the error message, I think a touniformstring() should help to convert the data type from list-of-user to list-of-string.
Worked Thank You ,