public interface PrivilegeManager
When the privilege system is initialized two special users, root and anonymous, will be created by default.
initializePrivilege(java.lang.String)
.
anonymous
.
The privilege system also follows a hierarchical model. That is, If a user has a privilege on an identifier A, he also has this privilege on identifier B, where A is a prefix of B. Identifiers can be
Modifier and Type | Field and Description |
---|---|
static String |
IDENTIFIER_WHOLE_CATALOG |
static String |
PASSWORD_ANONYMOUS |
static String |
USER_ANONYMOUS |
static String |
USER_ROOT |
Modifier and Type | Method and Description |
---|---|
void |
createUser(String user,
String password)
Create
user with password . |
void |
dropUser(String user)
Remove
user from the privilege system. |
PrivilegeChecker |
getPrivilegeChecker()
Get
PrivilegeChecker of this privilege system to check if a user has specific
privileges on an object. |
void |
grant(String user,
String identifier,
PrivilegeType privilege)
Grant
user with privilege on identifier . |
void |
initializePrivilege(String rootPassword)
Initialize the privilege system if not enabled.
|
void |
objectDropped(String identifier)
Notify the privilege system that the object with
identifier is dropped. |
void |
objectRenamed(String oldName,
String newName)
Notify the privilege system that the identifier of an object is changed from
oldName
to newName . |
boolean |
privilegeEnabled()
Check if the privilege system is enabled.
|
int |
revoke(String user,
String identifier,
PrivilegeType privilege)
Revoke
privilege from user on identifier . |
static final String USER_ROOT
static final String USER_ANONYMOUS
static final String PASSWORD_ANONYMOUS
static final String IDENTIFIER_WHOLE_CATALOG
boolean privilegeEnabled()
void initializePrivilege(String rootPassword)
void dropUser(String user)
user
from the privilege system.void grant(String user, String identifier, PrivilegeType privilege)
user
with privilege
on identifier
.int revoke(String user, String identifier, PrivilegeType privilege)
privilege
from user
on identifier
. Note that user
will
also lose privilege
on all descendants of identifier
.void objectRenamed(String oldName, String newName)
oldName
to newName
.void objectDropped(String identifier)
identifier
is dropped.PrivilegeChecker getPrivilegeChecker()
PrivilegeChecker
of this privilege system to check if a user has specific
privileges on an object.Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.