|
|
@ -404,10 +404,15 @@ public class RoleManagementServiceImpl implements RoleManagementService {
|
|
|
|
// Get all role permissions
|
|
|
|
// Get all role permissions
|
|
|
|
final UIPermissionNode rolePermissions = this.getAllRolePermissions(roleName, userRealm);
|
|
|
|
final UIPermissionNode rolePermissions = this.getAllRolePermissions(roleName, userRealm);
|
|
|
|
List<String> permissions = new ArrayList<String>();
|
|
|
|
List<String> permissions = new ArrayList<String>();
|
|
|
|
|
|
|
|
final UIPermissionNode emmRolePermissions = (UIPermissionNode)this.getRolePermissions(roleName);
|
|
|
|
|
|
|
|
List<String> emmConsolePermissions = new ArrayList<String>();
|
|
|
|
|
|
|
|
this.getAuthorizedPermissions(emmRolePermissions, emmConsolePermissions);
|
|
|
|
|
|
|
|
emmConsolePermissions.removeAll(new ArrayList<String>(Arrays.asList(roleInfo.getPermissions())));
|
|
|
|
this.getAuthorizedPermissions(rolePermissions, permissions);
|
|
|
|
this.getAuthorizedPermissions(rolePermissions, permissions);
|
|
|
|
for (String permission : roleInfo.getPermissions()) {
|
|
|
|
for (String permission : roleInfo.getPermissions()) {
|
|
|
|
permissions.add(permission);
|
|
|
|
permissions.add(permission);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
permissions.removeAll(emmConsolePermissions);
|
|
|
|
String [] allApplicablePerms = new String[permissions.size()];
|
|
|
|
String [] allApplicablePerms = new String[permissions.size()];
|
|
|
|
allApplicablePerms = permissions.toArray(allApplicablePerms);
|
|
|
|
allApplicablePerms = permissions.toArray(allApplicablePerms);
|
|
|
|
roleInfo.setPermissions(allApplicablePerms);
|
|
|
|
roleInfo.setPermissions(allApplicablePerms);
|
|
|
|