Allow user with a specific role to be able to add/remove group member for group with specific type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 06:41 AM
Hi All,
The Requirement is that if user has a role "custom_admin"(this role has been created in a custom app) and the group type is either patch or ops, then this user should be able to add or remove members from the group. to achieve this, i have written 3 ACL's on sys_user_grmember table with operation as read, write, delete and create and have defined this condition and roles. I am able to view the group members, it also gives the new button on gr member table, but doesnt give the edit option. I am also able to select the member and delete from list view post impersonating. could you please assist on how i can achieve the edit option to show up on the groupmember table in list view of groups as per the condition?
i do not see any error or warning in the ACL debugging as well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 06:58 AM
Hi @Atheher Fathima ,
Check the List Control for edit button setting/configuration on group members form , if there is any condition or role based permissions applied.
-Thanks
AshishKMishra
Please accept solution and mark helpful for others if it helps you.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:08 AM - edited 11-09-2023 07:10 AM
@AshishKM ,
no we do not have any condition defined. I tried to define the condition as below, but it did not work either
"
var answer = false; // Show the 'Edit' button by default
if (gs.hasRole('admin')) {
// Check if the 'type' field of the group matches the specified values
if (current.group.type == 'a71806121be7d11068ff86e3604bcb1c' || current.group.type == '0024365e1babd11068ff86e3604bcbaa') {
answer = true; // Allow 'Edit' button for users with the specified role and when the 'type' condition is met
}
}
answer;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:37 AM - edited 11-09-2023 07:38 AM
Hi,
I think , this script code from the write ACL.
are you sure about the If condition check in your code , as you said there is "custom_admin" role but condition is checking "admin" role.
if (gs.hasRole('admin')) {
-Thanks,
Ashish
Please accept solution and mark helpful for others if it helps you.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:43 AM
Hi @AshishKM ,
Sorry about the confusion, the code i shared was something i had written under omit edit condition on group member table edit list.
below is the snippet of the ACL . i am masking the name of the role
I did verify that the role is entered correctly in the omit edit condition