Skip to content

Commit

Permalink
RANGER-3837: Changed ensureAdminAccess and getRoleIfAccessible so tha…
Browse files Browse the repository at this point in the history
…t both admins and service admins can now get,create,edit,delete roles

Signed-off-by: pradeep <pradeep@apache.org>
  • Loading branch information
fateh288 authored and pradeepagrawal8184 committed Aug 23, 2022
1 parent 78940d6 commit 8127577
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ private void ensureAdminAccess(String serviceName, String userName) throws Excep
effectiveUser = loggedInUser;
}

if (!bizUtil.isUserRangerAdmin(effectiveUser)) {
if (!bizUtil.isUserRangerAdmin(effectiveUser) && !svcStore.isServiceAdminUser(serviceName, effectiveUser)) {
throw new Exception("User " + effectiveUser + " does not have permission for this operation");
}
}
Expand Down Expand Up @@ -937,7 +937,7 @@ private RangerRole getRoleIfAccessible(String roleName, String serviceName, Stri
effectiveUser = loggedInUser;
}
try {
if (!bizUtil.isUserRangerAdmin(effectiveUser)) {
if (!bizUtil.isUserRangerAdmin(effectiveUser) && !svcStore.isServiceAdminUser(serviceName, effectiveUser)) {
existingRole = roleStore.getRole(roleName);
ensureRoleAccess(effectiveUser, userGroups, existingRole);

Expand Down

0 comments on commit 8127577

Please sign in to comment.