Class Permission
java.lang.Object
org.apache.hadoop.io.VersionedWritable
org.apache.hadoop.hbase.security.access.Permission
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
- Direct Known Subclasses:
GlobalPermission,NamespacePermission,TablePermission
Base permissions instance representing the ability to perform a given set of actions.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final classprotected static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Map<Byte,Permission.Action> protected EnumSet<Permission.Action>private static final org.slf4j.Loggerprotected Permission.Scopeprotected static final Map<Byte,Permission.Scope> protected static final byte -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for Writable implementation.Permission(byte[] actionCodes) Permission(Permission.Action... assigned) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanCheck if two permission equals regardless of actions.byteReturns the object version numberinthashCode()booleanimplies(Permission.Action action) check if given action is grantedstatic Permission.BuilderBuild a global permissionstatic Permission.BuildernewBuilder(String namespace) Build a namespace permissionstatic Permission.BuildernewBuilder(TableName tableName) Build a table permissionprotected StringvoidreadFields(DataInput in) voidsetActions(Permission.Action[] assigned) toString()voidwrite(DataOutput out)
-
Field Details
-
VERSION
- See Also:
-
LOG
-
ACTION_BY_CODE
-
SCOPE_BY_CODE
-
actions
-
scope
-
-
Constructor Details
-
Permission
public Permission()Empty constructor for Writable implementation. Do not use. -
Permission
-
Permission
-
-
Method Details
-
getActions
-
implies
check if given action is granted- Parameters:
action- action to be checked- Returns:
- true if granted, false otherwise
-
setActions
-
equalsExceptActions
Check if two permission equals regardless of actions. It is useful when merging a new permission with an existed permission which needs to check two permissions's fields.- Parameters:
obj- instance- Returns:
- true if equals, false otherwise
-
equals
-
hashCode
-
toString
-
rawExpression
-
getVersion
Returns the object version number- Specified by:
getVersionin classorg.apache.hadoop.io.VersionedWritable
-
readFields
- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Overrides:
readFieldsin classorg.apache.hadoop.io.VersionedWritable- Throws:
IOException
-
write
- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Overrides:
writein classorg.apache.hadoop.io.VersionedWritable- Throws:
IOException
-
getAccessScope
-
newBuilder
Build a global permission- Returns:
- global permission builder
-
newBuilder
Build a namespace permission- Parameters:
namespace- the specific namespace- Returns:
- namespace permission builder
-
newBuilder
Build a table permission- Parameters:
tableName- the specific table name- Returns:
- table permission builder
-