Fix permission updating issue

pull/269/head^2
commit 894501b999

@ -732,16 +732,15 @@ public class APIPublisherServiceImpl implements APIPublisherService {
} }
private void updatePermissions(String role, List<String> permissions) throws UserStoreException { private void updatePermissions(String role, List<String> permissions) throws UserStoreException {
if (role == null || permissions == null) return;
AuthorizationManager authorizationManager = APIPublisherDataHolder.getInstance().getUserRealm() AuthorizationManager authorizationManager = APIPublisherDataHolder.getInstance().getUserRealm()
.getAuthorizationManager(); .getAuthorizationManager();
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Updating the role '" + role + "'"); log.debug("Updating the role '" + role + "'");
} }
if (permissions != null && !permissions.isEmpty()) { authorizationManager.clearRoleAuthorization(role);
authorizationManager.clearRoleAuthorization(role); for (String permission : permissions) {
for (String permission : permissions) { authorizationManager.authorizeRole(role, permission, CarbonConstants.UI_PERMISSION_ACTION);
authorizationManager.authorizeRole(role, permission, CarbonConstants.UI_PERMISSION_ACTION);
}
} }
} }

Loading…
Cancel
Save