mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix permission updating issue
This commit is contained in:
parent
50f369fe87
commit
29132ba84d
@ -732,18 +732,17 @@ public class APIPublisherServiceImpl implements APIPublisherService {
|
||||
}
|
||||
|
||||
private void updatePermissions(String role, List<String> permissions) throws UserStoreException {
|
||||
if (role == null || permissions == null) return;
|
||||
AuthorizationManager authorizationManager = APIPublisherDataHolder.getInstance().getUserRealm()
|
||||
.getAuthorizationManager();
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Updating the role '" + role + "'");
|
||||
}
|
||||
if (permissions != null && !permissions.isEmpty()) {
|
||||
authorizationManager.clearRoleAuthorization(role);
|
||||
for (String permission : permissions) {
|
||||
authorizationManager.authorizeRole(role, permission, CarbonConstants.UI_PERMISSION_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addRole(String role) throws UserStoreException {
|
||||
UserStoreManager userStoreManager = APIPublisherDataHolder.getInstance().getUserStoreManager();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user