smengcl commented on a change in pull request #3177:
URL: https://github.com/apache/ozone/pull/3177#discussion_r827620496
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManagerImpl.java
##########
@@ -378,9 +382,60 @@ public void deactivateUser(String accessID)
}
- @Override
- public boolean isTenantAdmin(String user, String tenantId) {
- return true;
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isTenantAdmin(UserGroupInformation callerUgi,
+ String tenantId, Boolean delegated) {
+ if (callerUgi == null) {
+ return false;
+ } else {
+ return isTenantAdmin(
+ callerUgi.getShortUserName(), tenantId, delegated)
+ || isTenantAdmin(
+ callerUgi.getUserName(), tenantId, delegated)
+ || ozoneManager.isAdmin(callerUgi.getShortUserName())
+ || ozoneManager.isAdmin(callerUgi.getUserName());
+ }
+ }
+
+ /**
+ * Internal isTenantAdmin method that takes a username String instead of UGI.
+ */
+ private boolean isTenantAdmin(String username, String tenantId,
+ Boolean delegated) {
Review comment:
Good point. Not sure why I used wrapper object at the time. Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]