Class Superusers

java.lang.Object
org.apache.hadoop.hbase.security.Superusers

@Private public final class Superusers extends Object
Keeps lists of superusers and super groups loaded from HBase configuration, checks if certain user is regarded as superuser.
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      public static void initialize(org.apache.hadoop.conf.Configuration conf) throws IOException
      Should be called only once to pre-load list of super users and super groups from Configuration. This operation is idempotent.
      Parameters:
      conf - configuration to load users from
      Throws:
      IOException - if unable to initialize lists of superusers or super groups
      IllegalStateException - if current user is null
    • isSuperUser

      public static boolean isSuperUser(User user)
      Check if the current user is a super user
      Parameters:
      user - to check
      Returns:
      true if current user is a super user (whether as user running process, declared as individual superuser or member of supergroup), false otherwise.
      Throws:
      IllegalStateException - if lists of superusers/super groups haven't been initialized properly
    • isSuperUser

      public static boolean isSuperUser(String user)
      Check if the current user is a super user
      Parameters:
      user - to check
      Returns:
      true if current user is a super user, false otherwise.
    • getSuperUsers

      public static Collection<String> getSuperUsers()
    • getSuperGroups

      public static Collection<String> getSuperGroups()
    • getSystemUser

      public static User getSystemUser()