Managed Role Script Hooks

Like any other managed object, you can use script hooks to configure role behavior. The default role definition in conf/managed.json includes an onDelete hook that calls a script to prevent the role from being deleted if it is currently assigned to users:

{
    "name" : "role",
    "onDelete" : {
        "type" : "text/javascript",
        "file" : "roles/onDelete-roles.js"
    },
    ...
Read a different version of :