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
Modifier and TypeClassDescriptionstatic enum
static final class
protected static enum
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Map<Byte,
Permission.Action> protected EnumSet<Permission.Action>
private static final org.slf4j.Logger
protected Permission.Scope
protected static final Map<Byte,
Permission.Scope> protected static final byte
-
Constructor Summary
ConstructorDescriptionEmpty constructor for Writable implementation.Permission
(byte[] actionCodes) Permission
(Permission.Action... assigned) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Check if two permission equals regardless of actions.byte
Returns the object version numberint
hashCode()
boolean
implies
(Permission.Action action) check if given action is grantedstatic Permission.Builder
Build a global permissionstatic Permission.Builder
newBuilder
(String namespace) Build a namespace permissionstatic Permission.Builder
newBuilder
(TableName tableName) Build a table permissionprotected String
void
readFields
(DataInput in) void
setActions
(Permission.Action[] assigned) toString()
void
write
(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:
getVersion
in classorg.apache.hadoop.io.VersionedWritable
-
readFields
- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
readFields
in classorg.apache.hadoop.io.VersionedWritable
- Throws:
IOException
-
write
- Specified by:
write
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
write
in 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
-