Package org.apache.hadoop.hbase.security
Class Superusers
java.lang.Object
org.apache.hadoop.hbase.security.Superusers
Keeps lists of superusers and super groups loaded from HBase configuration, checks if certain
 user is regarded as superuser.
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate static org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<String>static final StringConfiguration key for superusersprivate static org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<String>private static User - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<String>static Collection<String>static Userstatic voidinitialize(org.apache.hadoop.conf.Configuration conf) Should be called only once to pre-load list of super users and super groups from Configuration.static booleanisSuperUser(String user) Check if the current user is a super userstatic booleanisSuperUser(User user) Check if the current user is a super user 
- 
Field Details
- 
LOG
 - 
SUPERUSER_CONF_KEY
Configuration key for superusers- See Also:
 
 - 
superUsers
private static org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<String> superUsers - 
superGroups
private static org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<String> superGroups - 
systemUser
 
 - 
 - 
Constructor Details
- 
Superusers
private Superusers() 
 - 
 - 
Method Details
- 
initialize
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 groupsIllegalStateException- if current user is null
 - 
isSuperUser
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
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
 - 
getSuperGroups
 - 
getSystemUser
 
 -