Skip to content

Commit

Permalink
HDDS-1885. Fix bug in checkAcls in OzoneManager. (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatviswa504 authored Aug 1, 2019
1 parent b008072 commit c1f7440
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1801,17 +1801,16 @@ public void checkAcls(ResourceType resType, StoreType storeType,
.setVolumeName(vol)
.setBucketName(bucket)
.setKeyName(key).build();
UserGroupInformation user = ProtobufRpcEngine.Server.getRemoteUser();
RequestContext context = RequestContext.newBuilder()
.setClientUgi(user)
.setIp(ProtobufRpcEngine.Server.getRemoteIp())
.setClientUgi(ugi)
.setIp(remoteAddress)
.setAclType(ACLIdentityType.USER)
.setAclRights(aclType)
.build();
if (!accessAuthorizer.checkAccess(obj, context)) {
LOG.warn("User {} doesn't have {} permission to access {}",
user.getUserName(), aclType, resType);
throw new OMException("User " + user.getUserName() + " doesn't " +
ugi.getUserName(), aclType, resType);
throw new OMException("User " + ugi.getUserName() + " doesn't " +
"have " + aclType + " permission to access " + resType,
ResultCodes.PERMISSION_DENIED);
}
Expand Down

0 comments on commit c1f7440

Please sign in to comment.