mirror of
https://github.com/bmlong137/alfresco-keycloak.git
synced 2025-09-17 14:21:10 +00:00
Enhance authority display name
This commit is contained in:
@@ -13,8 +13,6 @@ function main()
|
|||||||
permissionObj = permissions.getJSONObject(idx);
|
permissionObj = permissions.getJSONObject(idx);
|
||||||
add = !permissionObj.has('remove') || !permissionObj.getBoolean('remove');
|
add = !permissionObj.has('remove') || !permissionObj.getBoolean('remove');
|
||||||
|
|
||||||
if (add)
|
|
||||||
{
|
|
||||||
authority = permissionObj.getString('authority');
|
authority = permissionObj.getString('authority');
|
||||||
permission = permissionObj.getString('role');
|
permission = permissionObj.getString('role');
|
||||||
|
|
||||||
@@ -33,9 +31,15 @@ function main()
|
|||||||
|
|
||||||
// only process if role mapped from Keycloak
|
// only process if role mapped from Keycloak
|
||||||
if (keycloakRolesHash.hasOwnProperty(authority))
|
if (keycloakRolesHash.hasOwnProperty(authority))
|
||||||
|
{
|
||||||
|
if (add)
|
||||||
{
|
{
|
||||||
node.setPermission(permission, authority);
|
node.setPermission(permission, authority);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node.removePermission(permission, authority);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user