Restricting Git Operations
Adding Restrictions to Git Operations
All Git operations are visible to users by default. You can restrict users or profiles to access only certain 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 in this custom setting. In this example, the users will see Commit Files (always available) and Recommit Files (The Destructive Changes and Full Profiles & Permission Sets operations will not be visible).
The process for restricting Git operations is as follows:
- 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 Restrictions from Git Operations
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
Restriction works from User Level to Profile Level and then to Default Organization Level restrictions. As an example, in your production organization there is a Developer Profile that has been assigned to two different users called Dave and Ana, and you would like users with the Developer Profile to have access to the Destructive Changes Git operation except for Dave. You also would like Dave, but not the other users with the Developer Profile, to have access to the Full Profiles & Permission Sets operation. Then you could do the following:
Organization Default Level: Recommit Files.
Profile Level (Developer Profile): Recommit Files; Destructive Changes.
User Level (Dave): Recommit Files; Full Profiles & Permission Sets.
When Dave opens the Commit Changes page, he will see the Commit Changes, Recommit Files, Full Profiles & Permission Sets Git operations.
When Ana opens the Commit Changes page, she will see the Commit Changes, Recommit Files, Destructive Changes Git operations.