Restricting Git Operations
Adding Restrictions to Git Operations
By default, users have access to all Git operations. However, there might be occasions when you want to restrict users access to certain Git operations.
Copado allows you to prevent users or profiles from accessing specific Git operations by adding a record to a custom setting called Git Operation Restriction. For example, if you only want users to see the Recommit Files option, simply add Recommit Files to this custom setting. In this case, users will just see Commit Files, which is always available, and Recommit Files (the Destructive Changes and Full Profiles & Permission Sets operations will not be visible).
To restrict Git operations, follow the steps below:
- Go to Setup -> Custom Settings.
- Click on Manage in the Git Operation Restriction custom setting.
- Click on New.
- Select Profile or User from Location.
- Write the specific Git operation(s) that should be visible in a semi-colon-separated list, (e.g. if you want your users to see Recommit Files and Destructive Changes enter Recommit Files;Destructive Changes in the Git Operation Name field):
- Check the Active checkbox.
- Click on Save.
Now your selected profile or user will only see the Git operation(s) you entered in the custom setting.
Removing Git Operation Restrictions
To remove a restriction follow the steps below:
- Uncheck the Active checkbox from the related Git Operation Restriction record and click on Save.
- Delete the related Git Operation Restriction record.
Considerations on Restricting Git Operations
Restrictions work from user level to profile level and then to default organization level.
Let's say there is a developer profile in your production organization that has been assigned to two different users, Dave and Ana, and you want all users with this profile except for Dave to have access to Destructive Changes. Additionally, you want to grant Dave, and no one else with the developer profile, access to Full Profiles & Permission Sets. This is how you can set this up:
Organization default level: Recommit Files.
Profile level (developer profile): Recommit Files; Destructive Changes.
User level (Dave): Recommit Files; Full Profiles & Permission Sets.
If Dave opens the Commit Changes page, he will see the Commit Changes, Recommit Files and Full Profiles & Permission Sets Git operations.
If Ana opens the Commit Changes page, she will see the Commit Changes, Recommit Files and Destructive Changes Git operations.