Fixing the permission management issue in EMM console

revert-70aa11f8
kamidu 8 years ago
parent bc01e5e1e9
commit 4588cfbed4

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

Loading…
Cancel
Save