Skip to content

Instantly share code, notes, and snippets.

@Azsaturndx
Created April 9, 2020 20:54
Show Gist options
  • Save Azsaturndx/6df2f70c83c0d26e7e15303da2d5c35b to your computer and use it in GitHub Desktop.
Save Azsaturndx/6df2f70c83c0d26e7e15303da2d5c35b to your computer and use it in GitHub Desktop.
Hide role GUI controls - Code onTime
/**
* Hide Roles controls
* (Code onTime)
* AzsaturnDx (2020) - No copyright at all
*
* Hides all role-based controls from user.
*
*/
// Expressed in milliseconds
var refreshInterval = 250;
removeElementsLoop();
function removeElementsLoop() {
setTimeout(function () {
//Hides "Roles" field in a single user edit form
$("span[data-field='Roles']").parent().hide();
//Hides "Roles" option in view selector
$("a.ui-btn[data-text='Roles']").hide();
removeElementsLoop();
}, refreshInterval);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment