public class GrantManager
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
CATALOG |
Represents a CATALOG object to grant privs over for this user.
|
static int |
DOMAIN |
Represents a DOMAIN object to grant privs over for the user.
|
static TObject |
PUBLIC_USERNAME |
The name of the 'public' username.
|
static java.lang.String |
PUBLIC_USERNAME_STR |
The string representing the public user (privs granted to all users).
|
static int |
SCHEMA |
Represents a SCHEMA object to grant privs over for the user.
|
static int |
TABLE |
Represents a TABLE object to grant privs over for the user.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addGrant(Privileges privs,
int object,
java.lang.String param,
java.lang.String grantee,
boolean grant_option,
java.lang.String granter) |
Adds a grant on the given database object.
|
void |
addGrantToAllTablesInSchema(java.lang.String schema,
Privileges privs,
java.lang.String grantee,
boolean grant_option,
java.lang.String granter) |
For all tables in the given schema, this adds the given grant for each
of the tables.
|
void |
removeGrant(Privileges privs,
int object,
java.lang.String param,
java.lang.String grantee,
boolean grant_option,
java.lang.String granter) |
Removes a grant on the given object for the given grantee, grant option
and granter.
|
void |
revokeAllGrantsOnObject(int object,
java.lang.String param) |
Completely removes all privs granted on the given object for all users.
|
void |
revokeAllGrantsOnObject(int object,
java.lang.String param,
java.lang.String grantee,
boolean grant_option,
java.lang.String granter) |
Removes all privs granted on the given object for the given grantee with
the given grant option.
|
Privileges |
userGrantOptions(int object,
java.lang.String param,
java.lang.String username) |
Returns all Privileges for the given object for the given grantee (user)
that the user is allowed to give grant options for.
|
Privileges |
userGrants(int object,
java.lang.String param,
java.lang.String username) |
Returns all Privileges for the given object for the given grantee (user).
|
public static final int TABLE
public static final int DOMAIN
public static final int SCHEMA
public static final int CATALOG
public static final java.lang.String PUBLIC_USERNAME_STR
public static final TObject PUBLIC_USERNAME
public void addGrant(Privileges privs, int object, java.lang.String param, java.lang.String grantee, boolean grant_option, java.lang.String granter) throws DatabaseException
privs
- the privileges to grant.object
- the object to grant (TABLE, DOMAIN, etc)param
- the parameter of the object (eg. the table name)grantee
- the user name to grant the privs to.grant_option
- if true, allows the user to pass grants to other
users.granter
- the user granting.DatabaseException
public void addGrantToAllTablesInSchema(java.lang.String schema, Privileges privs, java.lang.String grantee, boolean grant_option, java.lang.String granter) throws DatabaseException
DatabaseException
public void removeGrant(Privileges privs, int object, java.lang.String param, java.lang.String grantee, boolean grant_option, java.lang.String granter) throws DatabaseException
DatabaseException
public void revokeAllGrantsOnObject(int object, java.lang.String param, java.lang.String grantee, boolean grant_option, java.lang.String granter) throws DatabaseException
DatabaseException
public void revokeAllGrantsOnObject(int object, java.lang.String param) throws DatabaseException
DatabaseException
public Privileges userGrants(int object, java.lang.String param, java.lang.String username) throws DatabaseException
Note that the Privileges object includes all the grants on the object given to PUBLIC also.
This method will concatenate multiple privs granted on the same object.
PERFORMANCE: This method is called a lot (at least once on every query).
DatabaseException
public Privileges userGrantOptions(int object, java.lang.String param, java.lang.String username) throws DatabaseException
Note that the Privileges object includes all the grants on the object given to PUBLIC also.
This method will concatenate multiple grant options given on the same object to the user.
DatabaseException
Copyright © 2018. All rights reserved.