code: public static void checkSuperuserPrivilege(UserGroupInformation owner, 
                                               String supergroup) 
    throws AccessControlException {
      PermissionChecker checker = 
        new PermissionChecker(owner.getUserName(), supergroup);
      if (!checker.isSuper) {
        throw new AccessControlException("Access denied for user " 
            + checker.user + ". Superuser privilege is required");
      }
    }
docs: Verify if the caller has the required permission. This will result into
  an exception if the caller is not allowed to access the resource.
  @param owner owner of the system
  @param supergroup supergroup of the system