Top Description Fields Constructors Methods
org.h2.engine

public final Class Right

extends DbObject
Class Inheritance
Imports
org.h2.message.DbException, .Trace, org.h2.schema.Schema, org.h2.table.Table

An access right. Rights are regular database objects, but have generated names.

Field Summary

Modifier and TypeField and Description
public static final int
ALL

The right bit mask that means: select, insert, update, delete, and update for this object is allowed.

public static final int
ALTER_ANY_SCHEMA

The right bit mask that means: create/alter/drop schema is allowed.

public static final int
DELETE

The right bit mask that means: deleting rows from a table is allowed.

private DbObject
grantedObject

The object.

private int
grantedRight

The granted right.

private Role
grantedRole

The granted role, or null if a right was granted.

private RightOwner
grantee

To whom the right is granted.

public static final int
INSERT

The right bit mask that means: inserting rows into a table is allowed.

public static final int
SCHEMA_OWNER

The right bit mask that means: user is a schema owner.

public static final int
SELECT

The right bit mask that means: selecting from a table is allowed.

public static final int
UPDATE

The right bit mask that means: updating data is allowed.

Inherited from org.h2.engine.DbObject:
AGGREGATECOMMENTcommentCONSTANTCONSTRAINTdatabaseDOMAINFUNCTION_ALIASINDEXRIGHTROLESCHEMASEQUENCESETTINGSYNONYMTABLE_OR_VIEWtraceTRIGGERUSER

Constructor Summary

AccessConstructor and Description
public
Right(Database db, int id, RightOwner grantee, Role grantedRole)

public
Right(Database db, int id, RightOwner grantee, int grantedRight, DbObject grantedObject)

Method Summary

Modifier and TypeMethod and Description
private static boolean
appendRight(StringBuilder buff, int right, int mask, String name, boolean comma)

public void
checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Check if renaming is allowed.

public String
getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ...

public String
getCreateSQLForCopy(Table
the new table
table
,
String
the quoted name
quotedName
)

Overrides org.h2.engine.DbObject.getCreateSQLForCopy.

Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

private String
public DbObject
public Role
public DbObject
public int
public String
public int
getType()

Implements abstract org.h2.engine.DbObject.getType.

Get the object type.

public void
removeChildrenAndResources(SessionLocal
the session
session
)

Implements abstract org.h2.engine.DbObject.removeChildrenAndResources.

Delete all dependent children objects and resources of this object.

public void
setRightMask(int rightMask)

Inherited from org.h2.engine.DbObject:
getChildrengetCommentgetCreateSQLForMetagetDatabasegetDropSQLgetIdgetModificationIdgetNamegetSQLgetSQLinvalidateisTemporaryisValidrenamesetCommentsetModifiedsetObjectNamesetTemporarytoString

Field Detail

ALLback to summary
public static final int ALL

The right bit mask that means: select, insert, update, delete, and update for this object is allowed.

ALTER_ANY_SCHEMAback to summary
public static final int ALTER_ANY_SCHEMA

The right bit mask that means: create/alter/drop schema is allowed.

DELETEback to summary
public static final int DELETE

The right bit mask that means: deleting rows from a table is allowed.

grantedObjectback to summary
private DbObject grantedObject

The object. If the right is global, this is null.

grantedRightback to summary
private int grantedRight

The granted right.

grantedRoleback to summary
private Role grantedRole

The granted role, or null if a right was granted.

granteeback to summary
private RightOwner grantee

To whom the right is granted.

INSERTback to summary
public static final int INSERT

The right bit mask that means: inserting rows into a table is allowed.

SCHEMA_OWNERback to summary
public static final int SCHEMA_OWNER

The right bit mask that means: user is a schema owner. This mask isn't used in GRANT / REVOKE statements.

SELECTback to summary
public static final int SELECT

The right bit mask that means: selecting from a table is allowed.

UPDATEback to summary
public static final int UPDATE

The right bit mask that means: updating data is allowed.

Constructor Detail

Rightback to summary
public Right(Database db, int id, RightOwner grantee, Role grantedRole)
Rightback to summary
public Right(Database db, int id, RightOwner grantee, int grantedRight, DbObject grantedObject)

Method Detail

appendRightback to summary
private static boolean appendRight(StringBuilder buff, int right, int mask, String name, boolean comma)
checkRenameback to summary
public void checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Doc from org.h2.engine.DbObject.checkRename.

Check if renaming is allowed. Does nothing when allowed.

Annotations
@Override
getCreateSQLback to summary
public String getCreateSQL()

Implements abstract org.h2.engine.DbObject.getCreateSQL.

Doc from org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ... SQL statement for this object.

Returns:String

the SQL statement

Annotations
@Override
getCreateSQLForCopyback to summary
public String getCreateSQLForCopy(Table table, String quotedName)

Overrides org.h2.engine.DbObject.getCreateSQLForCopy.

Doc from org.h2.engine.DbObject.getCreateSQLForCopy.

Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table

Parameters
table:Table

the new table

quotedName:String

the quoted name

Returns:String

the SQL statement

Annotations
@Override
getCreateSQLForCopyback to summary
private String getCreateSQLForCopy(DbObject object)
getGrantedObjectback to summary
public DbObject getGrantedObject()
getGrantedRoleback to summary
public Role getGrantedRole()
getGranteeback to summary
public DbObject getGrantee()
getRightMaskback to summary
public int getRightMask()
getRightsback to summary
public String getRights()
getTypeback to summary
public int getType()

Implements abstract org.h2.engine.DbObject.getType.

Doc from org.h2.engine.DbObject.getType.

Get the object type.

Returns:int

the object type

Annotations
@Override
removeChildrenAndResourcesback to summary
public void removeChildrenAndResources(SessionLocal session)

Implements abstract org.h2.engine.DbObject.removeChildrenAndResources.

Doc from org.h2.engine.DbObject.removeChildrenAndResources.

Delete all dependent children objects and resources of this object.

Parameters
session:SessionLocal

the session

Annotations
@Override
setRightMaskback to summary
public void setRightMask(int rightMask)