Customizable roles cannot be edited when assigned
What does this MR do and why?
Solves #375661 (closed)
Screenshots or screen recordings
Relevant specs have been added to test the change.
How to set up and validate locally
-
Create a new member_role for a root level group
curl --request POST --header "Content-Type: application/json" --header "Authorization: Bearer $YOUR_ACCESS_TOKEN" --data '{"base_access_level":10, "download_code":1}' "https://gdk.test:3443/api/v4/groups/$GROUP_PATH/member_roles"
-
In rails console assign any member newly created member_role
group = Group.find_by(path: '$GROUP_PATH') user = User.find_by(email: '$TEST_USER_EMAIL') member_role = group.member_roles.first member = Member.where(user: user, source: group).first member.update!(member_role: member_role)
-
Try and update any attribute for new member_role and an exception should be raised
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Smriti Garg