Class AuthorizationEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity
-
- All Implemented Interfaces:
java.io.Serializable,Authorization,DbEntity,HasDbReferences,HasDbRevision
public class AuthorizationEntity extends java.lang.Object implements Authorization, DbEntity, HasDbRevision, HasDbReferences, java.io.Serializable
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intauthorizationTypeprotected java.lang.StringgroupIdprotected java.lang.Stringidprotected static EnginePersistenceLoggerLOGprotected intpermissionsprotected java.util.DateremovalTimeprotected java.lang.StringresourceIdprotected java.lang.IntegerresourceTypeprotected intrevisionprotected java.lang.StringrootProcessInstanceIdprotected java.lang.StringuserId-
Fields inherited from interface org.camunda.bpm.engine.authorization.Authorization
ANY, AUTH_TYPE_GLOBAL, AUTH_TYPE_GRANT, AUTH_TYPE_REVOKE
-
-
Constructor Summary
Constructors Constructor Description AuthorizationEntity()AuthorizationEntity(int type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPermission(Permission p)allows granting a permission.intgetAuthorizationType()The type og the authorization.java.util.Set<Permission>getCachedPermissions()java.lang.StringgetGroupId()java.lang.StringgetId()intgetPermissions()Permission[]getPermissions(Permission[] permissions)Allows checking whether this authorization grants / revokes a set of permissions.java.lang.ObjectgetPersistentState()Returns a representation of the object, as would be stored in the database.java.util.Map<java.lang.String,java.lang.Class>getReferencedEntitiesIdAndClass()Scope: IN-MEMORY referencesjava.util.Set<java.lang.String>getReferencedEntityIds()Scope: IN-MEMORY referencesjava.util.DategetRemovalTime()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.java.lang.IntegergetResource()java.lang.StringgetResourceId()intgetResourceType()intgetRevision()intgetRevisionNext()java.lang.StringgetRootProcessInstanceId()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.java.lang.StringgetUserId()booleanisEveryPermissionGranted()Allows checking whether this authorization grants every single permission.booleanisEveryPermissionRevoked()Allows checking whether this authorization revokes every single permission.booleanisPermissionGranted(Permission p)Allows checking whether this authorization grants a specific permission.booleanisPermissionRevoked(Permission p)Allows checking whether this authorization revokes a specific permission.voidremovePermission(Permission p)allows removing a permission.protected voidresetPermissions()voidsetAuthorizationType(int authorizationType)voidsetGroupId(java.lang.String groupId)set the id of the group this authorization is created forvoidsetId(java.lang.String id)voidsetPermissions(int permissions)voidsetPermissions(Permission[] permissions)Sets the permissions to the provided value.voidsetRemovalTime(java.util.Date removalTime)voidsetResource(Resource resource)sets the type of the resourcevoidsetResourceId(java.lang.String resourceId)set the id of the resourcevoidsetResourceType(int type)sets the type of the resourcevoidsetRevision(int revision)voidsetRootProcessInstanceId(java.lang.String rootProcessInstanceId)voidsetUserId(java.lang.String userId)set the id of the user this authorization is created forjava.lang.StringtoString()-
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 Detail
-
LOG
protected static final EnginePersistenceLogger LOG
-
id
protected java.lang.String id
-
revision
protected int revision
-
authorizationType
protected int authorizationType
-
permissions
protected int permissions
-
userId
protected java.lang.String userId
-
groupId
protected java.lang.String groupId
-
resourceType
protected java.lang.Integer resourceType
-
resourceId
protected java.lang.String resourceId
-
removalTime
protected java.util.Date removalTime
-
rootProcessInstanceId
protected java.lang.String rootProcessInstanceId
-
-
Method Detail
-
resetPermissions
protected void resetPermissions()
-
addPermission
public void addPermission(Permission p)
Description copied from interface:Authorizationallows granting a permission. Out-of-the-box constants can be found inPermissions.- Specified by:
addPermissionin interfaceAuthorization
-
removePermission
public void removePermission(Permission p)
Description copied from interface:Authorizationallows removing a permission. Out-of-the-box constants can be found inPermissions.- Specified by:
removePermissionin interfaceAuthorization
-
isPermissionGranted
public boolean isPermissionGranted(Permission p)
Description copied from interface:AuthorizationAllows checking whether this authorization grants a specific permission.- Specified by:
isPermissionGrantedin interfaceAuthorization
-
isPermissionRevoked
public boolean isPermissionRevoked(Permission p)
Description copied from interface:AuthorizationAllows checking whether this authorization revokes a specific permission.- Specified by:
isPermissionRevokedin interfaceAuthorization
-
isEveryPermissionGranted
public boolean isEveryPermissionGranted()
Description copied from interface:AuthorizationAllows checking whether this authorization grants every single permission.- Specified by:
isEveryPermissionGrantedin interfaceAuthorization- Returns:
- true if every single permission is granted otherwise false
-
isEveryPermissionRevoked
public boolean isEveryPermissionRevoked()
Description copied from interface:AuthorizationAllows checking whether this authorization revokes every single permission.- Specified by:
isEveryPermissionRevokedin interfaceAuthorization- Returns:
- true if every single permission is revoked otherwise false
-
getPermissions
public Permission[] getPermissions(Permission[] permissions)
Description copied from interface:AuthorizationAllows 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:
getPermissionsin interfaceAuthorization- Returns:
- Returns the set of
Permissionsprovided by thisAuthorization.
- For
-
setPermissions
public void setPermissions(Permission[] permissions)
Description copied from interface:AuthorizationSets 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:
setPermissionsin interfaceAuthorization
- For
-
getAuthorizationType
public int getAuthorizationType()
Description copied from interface:AuthorizationThe type og the authorization. Legal values:- Specified by:
getAuthorizationTypein interfaceAuthorization- Returns:
- the type of the authorization.
-
setAuthorizationType
public void setAuthorizationType(int authorizationType)
-
getGroupId
public java.lang.String getGroupId()
- Specified by:
getGroupIdin interfaceAuthorization- Returns:
- the id of the group this authorization is created for
-
setGroupId
public void setGroupId(java.lang.String groupId)
Description copied from interface:Authorizationset the id of the group this authorization is created for- Specified by:
setGroupIdin interfaceAuthorization
-
getUserId
public java.lang.String getUserId()
- Specified by:
getUserIdin interfaceAuthorization- Returns:
- the id of the user this authorization is created for
-
setUserId
public void setUserId(java.lang.String userId)
Description copied from interface:Authorizationset the id of the user this authorization is created for- Specified by:
setUserIdin interfaceAuthorization
-
getResourceType
public int getResourceType()
- Specified by:
getResourceTypein interfaceAuthorization- Returns:
- the type of the resource
-
setResourceType
public void setResourceType(int type)
Description copied from interface:Authorizationsets the type of the resource- Specified by:
setResourceTypein interfaceAuthorization
-
getResource
public java.lang.Integer getResource()
-
setResource
public void setResource(Resource resource)
Description copied from interface:Authorizationsets the type of the resource- Specified by:
setResourcein interfaceAuthorization
-
getResourceId
public java.lang.String getResourceId()
- Specified by:
getResourceIdin interfaceAuthorization- Returns:
- the id of the resource
-
setResourceId
public void setResourceId(java.lang.String resourceId)
Description copied from interface:Authorizationset the id of the resource- Specified by:
setResourceIdin interfaceAuthorization
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceAuthorization- Specified by:
getIdin interfaceDbEntity- Returns:
- the ID of the
Authorizationobject
-
getRevision
public int getRevision()
- Specified by:
getRevisionin interfaceHasDbRevision
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevisionin interfaceHasDbRevision
-
setPermissions
public void setPermissions(int permissions)
-
getPermissions
public int getPermissions()
-
getCachedPermissions
public java.util.Set<Permission> getCachedPermissions()
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNextin interfaceHasDbRevision
-
getPersistentState
public java.lang.Object getPersistentState()
Description copied from interface:DbEntityReturns 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:
getPersistentStatein interfaceDbEntity
-
getRemovalTime
public java.util.Date getRemovalTime()
Description copied from interface:AuthorizationThe 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:
getRemovalTimein interfaceAuthorization- Returns:
- the date the historic instance authorization is cleaned up
nullif not related to a historic instance resourcenullif removal time strategy is end and the top-level instance is not finished
-
setRemovalTime
public void setRemovalTime(java.util.Date removalTime)
-
getRootProcessInstanceId
public java.lang.String getRootProcessInstanceId()
Description copied from interface:AuthorizationThe 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:
getRootProcessInstanceIdin interfaceAuthorization- Returns:
- the process instance id of the top-level (root) process instance
nullif not related to a historic instance resource
-
setRootProcessInstanceId
public void setRootProcessInstanceId(java.lang.String rootProcessInstanceId)
-
getReferencedEntityIds
public java.util.Set<java.lang.String> getReferencedEntityIds()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntityIdsin interfaceHasDbReferences- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
public java.util.Map<java.lang.String,java.lang.Class> getReferencedEntitiesIdAndClass()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClassin 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-