public class HasPermissionRequest extends Object implements org.apache.avro.generic.IndexedRecord
GPUdb.hasPermission
.
Checks if the specified user has the specified permission on the specified object.
Modifier and Type | Class and Description |
---|---|
static class |
HasPermissionRequest.ObjectType
A set of string constants for the
HasPermissionRequest parameter
objectType . |
static class |
HasPermissionRequest.Options
A set of string constants for the
HasPermissionRequest parameter
options . |
static class |
HasPermissionRequest.Permission
A set of string constants for the
HasPermissionRequest parameter
permission . |
Constructor and Description |
---|
HasPermissionRequest()
Constructs a HasPermissionRequest object with default parameters.
|
HasPermissionRequest(String principal,
String object,
String objectType,
String permission,
Map<String,String> options)
Constructs a HasPermissionRequest object with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(int index)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
static org.apache.avro.Schema |
getClassSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
String |
getObject()
Name of object to check for the requested permission.
|
String |
getObjectType()
The type of object being checked.
|
Map<String,String> |
getOptions()
Optional parameters.
|
String |
getPermission()
Permission to check for.
|
String |
getPrincipal()
Name of the user for which the permission is being checked.
|
org.apache.avro.Schema |
getSchema()
This method supports the Avro framework and is not intended to be called
directly by the user.
|
int |
hashCode() |
void |
put(int index,
Object value)
This method supports the Avro framework and is not intended to be called
directly by the user.
|
HasPermissionRequest |
setObject(String object)
Name of object to check for the requested permission.
|
HasPermissionRequest |
setObjectType(String objectType)
The type of object being checked.
|
HasPermissionRequest |
setOptions(Map<String,String> options)
Optional parameters.
|
HasPermissionRequest |
setPermission(String permission)
Permission to check for.
|
HasPermissionRequest |
setPrincipal(String principal)
Name of the user for which the permission is being checked.
|
String |
toString() |
public HasPermissionRequest()
public HasPermissionRequest(String principal, String object, String objectType, String permission, Map<String,String> options)
principal
- Name of the user for which the permission is being
checked. Must be an existing user. If blank, will use
the current user. The default value is ''.object
- Name of object to check for the requested permission. It
is recommended to use a fully-qualified name when
possible.objectType
- The type of object being checked.
Supported values:
CONTEXT
: Context
CREDENTIAL
:
Credential
DATASINK
: Data
Sink
DATASOURCE
:
Data Source
DIRECTORY
: KiFS
File Directory
GRAPH
: A Graph
object
PROC
: UDF Procedure
SCHEMA
: Schema
SQL_PROC
: SQL
Procedure
SYSTEM
:
System-level access
TABLE
: Database
Table
TABLE_MONITOR
: Table monitor
permission
- Permission to check for.
Supported values:
ADMIN
: Full
read/write and administrative access on the
object.
CONNECT
: Connect
access on the given data source or data sink.
CREATE
: Ability to
create new objects of this type.
DELETE
: Delete rows
from tables.
EXECUTE
: Ability
to Execute the Procedure object.
INSERT
: Insert
access to tables.
READ
: Ability to
read, list and use the object.
UPDATE
: Update
access to the table.
USER_ADMIN
:
Access to administer users and roles that do
not have system_admin permission.
WRITE
: Access to
write, change and delete objects.
options
- Optional parameters.
NO_ERROR_IF_NOT_EXISTS
: If FALSE
will return an error if the provided
object
does not exist or is blank. If
TRUE
then it will return
FALSE
for hasPermission
.
Supported values:
The default value is FALSE
.
Map
.public static org.apache.avro.Schema getClassSchema()
public String getPrincipal()
principal
.public HasPermissionRequest setPrincipal(String principal)
principal
- The new value for principal
.this
to mimic the builder pattern.public String getObject()
object
.public HasPermissionRequest setObject(String object)
object
- The new value for object
.this
to mimic the builder pattern.public String getObjectType()
CONTEXT
: Context
CREDENTIAL
: Credential
DATASINK
: Data Sink
DATASOURCE
: Data Source
DIRECTORY
: KiFS File Directory
GRAPH
: A Graph object
PROC
: UDF Procedure
SCHEMA
: Schema
SQL_PROC
: SQL Procedure
SYSTEM
: System-level access
TABLE
: Database Table
TABLE_MONITOR
: Table monitor
objectType
.public HasPermissionRequest setObjectType(String objectType)
CONTEXT
: Context
CREDENTIAL
: Credential
DATASINK
: Data Sink
DATASOURCE
: Data Source
DIRECTORY
: KiFS File Directory
GRAPH
: A Graph object
PROC
: UDF Procedure
SCHEMA
: Schema
SQL_PROC
: SQL Procedure
SYSTEM
: System-level access
TABLE
: Database Table
TABLE_MONITOR
: Table monitor
objectType
- The new value for objectType
.this
to mimic the builder pattern.public String getPermission()
ADMIN
: Full read/write and
administrative access on the object.
CONNECT
: Connect access on the given
data source or data sink.
CREATE
: Ability to create new objects
of this type.
DELETE
: Delete rows from tables.
EXECUTE
: Ability to Execute the
Procedure object.
INSERT
: Insert access to tables.
READ
: Ability to read, list and use the
object.
UPDATE
: Update access to the table.
USER_ADMIN
: Access to administer
users and roles that do not have system_admin permission.
WRITE
: Access to write, change and
delete objects.
permission
.public HasPermissionRequest setPermission(String permission)
ADMIN
: Full read/write and
administrative access on the object.
CONNECT
: Connect access on the given
data source or data sink.
CREATE
: Ability to create new objects
of this type.
DELETE
: Delete rows from tables.
EXECUTE
: Ability to Execute the
Procedure object.
INSERT
: Insert access to tables.
READ
: Ability to read, list and use the
object.
UPDATE
: Update access to the table.
USER_ADMIN
: Access to administer
users and roles that do not have system_admin permission.
WRITE
: Access to write, change and
delete objects.
permission
- The new value for permission
.this
to mimic the builder pattern.public Map<String,String> getOptions()
NO_ERROR_IF_NOT_EXISTS
:
If FALSE
will return an error if the
provided object
does not exist or is blank.
If TRUE
then it will return FALSE
for hasPermission
.
Supported values:
The default value is FALSE
.
Map
.options
.public HasPermissionRequest setOptions(Map<String,String> options)
NO_ERROR_IF_NOT_EXISTS
:
If FALSE
will return an error if the
provided object
does not exist or is blank.
If TRUE
then it will return FALSE
for hasPermission
.
Supported values:
The default value is FALSE
.
Map
.options
- The new value for options
.this
to mimic the builder pattern.public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
public Object get(int index)
get
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to getIndexOutOfBoundsException
public void put(int index, Object value)
put
in interface org.apache.avro.generic.IndexedRecord
index
- the position of the field to setvalue
- the value to setIndexOutOfBoundsException
Copyright © 2025. All rights reserved.