Class AuthorizationEntity
java.lang.Object
org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity
- All Implemented Interfaces:
Serializable
,Authorization
,DbEntity
,HasDbReferences
,HasDbRevision
public class AuthorizationEntity
extends Object
implements Authorization, DbEntity, HasDbRevision, HasDbReferences, Serializable
- Author:
- Daniel Meyer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected String
protected String
protected static final EnginePersistenceLogger
protected int
protected Date
protected String
protected Integer
protected int
protected String
protected String
Fields inherited from interface org.camunda.bpm.engine.authorization.Authorization
ANY, AUTH_TYPE_GLOBAL, AUTH_TYPE_GRANT, AUTH_TYPE_REVOKE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allows granting a permission.int
The type og the authorization.getId()
int
getPermissions
(Permission[] permissions) Allows checking whether this authorization grants / revokes a set of permissions.Returns a representation of the object, as would be stored in the database.Scope: IN-MEMORY referencesScope: IN-MEMORY referencesThe removal time indicates the date a historic instance authorization is cleaned up A removal time can only be assigned to a historic instance authorization.int
int
int
The process instance id of the top-level (root) process instance the historic instance authorization is related to A root process instance id is only assigned to a historic instance authorization.boolean
Allows checking whether this authorization grants every single permission.boolean
Allows checking whether this authorization revokes every single permission.boolean
Allows checking whether this authorization grants a specific permission.boolean
Allows checking whether this authorization revokes a specific permission.void
allows removing a permission.protected void
void
setAuthorizationType
(int authorizationType) void
setGroupId
(String groupId) set the id of the group this authorization is created forvoid
void
setPermissions
(int permissions) void
setPermissions
(Permission[] permissions) Sets the permissions to the provided value.void
setRemovalTime
(Date removalTime) void
setResource
(Resource resource) sets the type of the resourcevoid
setResourceId
(String resourceId) set the id of the resourcevoid
setResourceType
(int type) sets the type of the resourcevoid
setRevision
(int revision) void
setRootProcessInstanceId
(String rootProcessInstanceId) void
set the id of the user this authorization is created fortoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntities
-
Field Details
-
LOG
-
id
-
revision
protected int revision -
authorizationType
protected int authorizationType -
permissions
protected int permissions -
userId
-
groupId
-
resourceType
-
resourceId
-
removalTime
-
rootProcessInstanceId
-
-
Constructor Details
-
AuthorizationEntity
public AuthorizationEntity() -
AuthorizationEntity
public AuthorizationEntity(int type)
-
-
Method Details
-
resetPermissions
protected void resetPermissions() -
addPermission
Description copied from interface:Authorization
allows granting a permission. Out-of-the-box constants can be found inPermissions
.- Specified by:
addPermission
in interfaceAuthorization
-
removePermission
Description copied from interface:Authorization
allows removing a permission. Out-of-the-box constants can be found inPermissions
.- Specified by:
removePermission
in interfaceAuthorization
-
isPermissionGranted
Description copied from interface:Authorization
Allows checking whether this authorization grants a specific permission.- Specified by:
isPermissionGranted
in interfaceAuthorization
- Parameters:
p
- the permission to check for
-
isPermissionRevoked
Description copied from interface:Authorization
Allows checking whether this authorization revokes a specific permission.- Specified by:
isPermissionRevoked
in interfaceAuthorization
- Parameters:
p
- the permission to check for
-
isEveryPermissionGranted
public boolean isEveryPermissionGranted()Description copied from interface:Authorization
Allows checking whether this authorization grants every single permission.- Specified by:
isEveryPermissionGranted
in interfaceAuthorization
- Returns:
- true if every single permission is granted otherwise false
-
isEveryPermissionRevoked
public boolean isEveryPermissionRevoked()Description copied from interface:Authorization
Allows checking whether this authorization revokes every single permission.- Specified by:
isEveryPermissionRevoked
in interfaceAuthorization
- Returns:
- true if every single permission is revoked otherwise false
-
getPermissions
Description copied from interface:Authorization
Allows checking whether this authorization grants / revokes a set of permissions. Usually the set of built-in permissions is used:Permissions.values()
The return value of this method depends on the type of the authorization:- For
Authorization.AUTH_TYPE_GLOBAL
: all permissions in the parameter list granted by this authorization are returned. - For
Authorization.AUTH_TYPE_GRANT
: all permissions in the parameter list granted by this authorization are returned. - For
Authorization.AUTH_TYPE_REVOKE
: all permissions in the parameter list revoked by this authorization are returned.
- Specified by:
getPermissions
in interfaceAuthorization
- Parameters:
permissions
- an array of permissions to check for.- Returns:
- Returns the set of
Permissions
provided by thisAuthorization
.
- For
-
setPermissions
Description copied from interface:Authorization
Sets the permissions to the provided value. Replaces all permissions. The effect of this method depends on the type of this authorization:- For
Authorization.AUTH_TYPE_GLOBAL
: all provided permissions are granted. - For
Authorization.AUTH_TYPE_GRANT
: all provided permissions are granted. - For
Authorization.AUTH_TYPE_REVOKE
: all provided permissions are revoked.
- Specified by:
setPermissions
in interfaceAuthorization
- Parameters:
permissions
- a set of permissions.
- For
-
getAuthorizationType
public int getAuthorizationType()Description copied from interface:Authorization
The type og the authorization. Legal values:- Specified by:
getAuthorizationType
in interfaceAuthorization
- Returns:
- the type of the authorization.
-
setAuthorizationType
public void setAuthorizationType(int authorizationType) -
getGroupId
- Specified by:
getGroupId
in interfaceAuthorization
- Returns:
- the id of the group this authorization is created for
-
setGroupId
Description copied from interface:Authorization
set the id of the group this authorization is created for- Specified by:
setGroupId
in interfaceAuthorization
-
getUserId
- Specified by:
getUserId
in interfaceAuthorization
- Returns:
- the id of the user this authorization is created for
-
setUserId
Description copied from interface:Authorization
set the id of the user this authorization is created for- Specified by:
setUserId
in interfaceAuthorization
-
getResourceType
public int getResourceType()- Specified by:
getResourceType
in interfaceAuthorization
- Returns:
- the type of the resource
-
setResourceType
public void setResourceType(int type) Description copied from interface:Authorization
sets the type of the resource- Specified by:
setResourceType
in interfaceAuthorization
-
getResource
-
setResource
Description copied from interface:Authorization
sets the type of the resource- Specified by:
setResource
in interfaceAuthorization
-
getResourceId
- Specified by:
getResourceId
in interfaceAuthorization
- Returns:
- the id of the resource
-
setResourceId
Description copied from interface:Authorization
set the id of the resource- Specified by:
setResourceId
in interfaceAuthorization
-
getId
- Specified by:
getId
in interfaceAuthorization
- Specified by:
getId
in interfaceDbEntity
- Returns:
- the ID of the
Authorization
object
-
setId
-
getRevision
public int getRevision()- Specified by:
getRevision
in interfaceHasDbRevision
-
setRevision
public void setRevision(int revision) - Specified by:
setRevision
in interfaceHasDbRevision
-
setPermissions
public void setPermissions(int permissions) -
getPermissions
public int getPermissions() -
getCachedPermissions
-
getRevisionNext
public int getRevisionNext()- Specified by:
getRevisionNext
in interfaceHasDbRevision
-
getPersistentState
Description copied from interface:DbEntity
Returns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.- Specified by:
getPersistentState
in interfaceDbEntity
-
getRemovalTime
Description copied from interface:Authorization
The removal time indicates the date a historic instance authorization is cleaned up A removal time can only be assigned to a historic instance authorization. An authorization belongs to a historic instance when its resource type isResources.HISTORIC_TASK
.- Specified by:
getRemovalTime
in interfaceAuthorization
- Returns:
- the date the historic instance authorization is cleaned up
null
if not related to a historic instance resourcenull
if removal time strategy is end and the top-level instance is not finished
-
setRemovalTime
-
getRootProcessInstanceId
Description copied from interface:Authorization
The process instance id of the top-level (root) process instance the historic instance authorization is related to A root process instance id is only assigned to a historic instance authorization. An authorization is related to a historic instance when its resource type isResources.HISTORIC_TASK
.- Specified by:
getRootProcessInstanceId
in interfaceAuthorization
- Returns:
- the process instance id of the top-level (root) process instance
null
if not related to a historic instance resource
-
setRootProcessInstanceId
-
getReferencedEntityIds
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntityIds
in interfaceHasDbReferences
- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClass
in interfaceHasDbReferences
- Returns:
- a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
-
toString
-