Created
January 5, 2018 14:23
-
-
Save mchang-r7/7d6181284a2f8db5e9f0db5411b164f4 to your computer and use it in GitHub Desktop.
Revoke profile permissions in Salesforce Classic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputs = document.getElementsByTagName('input'); | |
for (var i = 0; i < inputs.length; i++) { | |
var input = inputs[i]; | |
// Clear user permissions | |
if (input.id.startsWith('userPerm___')) { | |
if (input.checked) { | |
input.click(); | |
} | |
} | |
// Clear CRUD permissions | |
if (input.id.startsWith('crud')) { | |
if (input.checked) { | |
input.click(); | |
} | |
} | |
} | |
var selects = document.getElementsByTagName('select'); | |
for (var i = 0; i < selects.length; i++) { | |
var select = selects[i]; | |
// Hide all tabs | |
if (select.id.startsWith('tab___')) { | |
select.value = "0"; // Tab Hidden | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment