Class TablePermission
java.lang.Object
org.apache.hadoop.io.VersionedWritable
org.apache.hadoop.hbase.security.access.Permission
org.apache.hadoop.hbase.security.access.TablePermission
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
Represents an authorization for access for the given actions, optionally restricted to the given
column family or column qualifier, over the given table. If the family property is
null
, it implies full table access.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.security.access.Permission
Permission.Action, Permission.Builder, Permission.Scope
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.security.access.Permission
ACTION_BY_CODE, actions, scope, SCOPE_BY_CODE, VERSION
-
Constructor Summary
ConstructorDescriptionTablePermission
(TableName table, byte[] family, byte[] qualifier, Permission.Action... assigned) Construct a table:family:qualifier permission. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Check if two permission equals regardless of actions.private boolean
failCheckFamily
(byte[] family) private boolean
failCheckQualifier
(byte[] qual) private boolean
failCheckTable
(TableName table) byte[]
byte[]
boolean
int
hashCode()
boolean
boolean
implies
(TableName table, byte[] family, byte[] qualifier, Permission.Action action) Check if given action can performs on given table:family:qualifier.boolean
implies
(TableName table, byte[] family, Permission.Action action) Check if given action can performs on given table:family.boolean
implies
(TableName table, KeyValue kv, Permission.Action action) Checks if this permission grants access to perform the given action on the given table and key value.protected String
void
readFields
(DataInput in) boolean
Check if fields of table in table permission equals.toString()
void
write
(DataOutput out) Methods inherited from class org.apache.hadoop.hbase.security.access.Permission
getAccessScope, getActions, getVersion, implies, newBuilder, newBuilder, newBuilder, setActions
-
Field Details
-
table
-
family
-
qualifier
-
-
Constructor Details
-
TablePermission
TablePermission(TableName table, byte[] family, byte[] qualifier, Permission.Action... assigned) Construct a table:family:qualifier permission.- Parameters:
table
- table namefamily
- family namequalifier
- qualifier nameassigned
- assigned actions
-
-
Method Details
-
getTableName
-
hasFamily
-
getFamily
-
hasQualifier
-
getQualifier
-
getNamespace
-
implies
Check if given action can performs on given table:family:qualifier.- Parameters:
table
- table namefamily
- family namequalifier
- qualifier nameaction
- one of [Read, Write, Create, Exec, Admin]- Returns:
- true if can, false otherwise
-
implies
Check if given action can performs on given table:family.- Parameters:
table
- table namefamily
- family nameaction
- one of [Read, Write, Create, Exec, Admin]- Returns:
- true if can, false otherwise
-
failCheckTable
-
failCheckFamily
-
failCheckQualifier
-
implies
Checks if this permission grants access to perform the given action on the given table and key value.- Parameters:
table
- the table on which the operation is being performedkv
- the KeyValue on which the operation is being requestedaction
- the action requested- Returns:
true
if the action is allowed over the given scope by this permission, otherwisefalse
-
tableFieldsEqual
Check if fields of table in table permission equals.- Parameters:
tp
- to be checked table permission- Returns:
- true if equals, false otherwise
-
equalsExceptActions
Description copied from class:Permission
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.- Overrides:
equalsExceptActions
in classPermission
- Parameters:
obj
- instance- Returns:
- true if equals, false otherwise
-
equals
- Overrides:
equals
in classPermission
-
hashCode
- Overrides:
hashCode
in classPermission
-
toString
- Overrides:
toString
in classPermission
-
rawExpression
- Overrides:
rawExpression
in classPermission
-
readFields
- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
readFields
in classPermission
- Throws:
IOException
-
write
- Specified by:
write
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
write
in classPermission
- Throws:
IOException
-