public void checkLockPermissions(User user, String namespace, TableName tableName,
    RegionInfo[] regionInfos, String reason) throws IOException {
    if (namespace != null && !namespace.isEmpty()) {
      requireNamespacePermission(user, reason, namespace, null, Action.ADMIN, Action.CREATE);
    } else if (tableName != null || (regionInfos != null && regionInfos.length > 0)) {
      // So, either a table or regions op. If latter, check perms ons table.
      TableName tn = tableName != null ? tableName : regionInfos[0].getTable();
      requireTablePermission(user, reason, tn, null, null, Action.ADMIN, Action.CREATE);
    } else {
      throw new DoNotRetryIOException("Invalid lock level when requesting permissions.");
    }
  }
Check if caller is granting or revoking superusers's or supergroups's permissions.
@param request         request name
@param caller          caller
@param userToBeChecked target user or group
@throws IOException AccessDeniedException if target user is superuser
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessChecker.java