org.camunda.bpm.engine.impl.persistence.entity
Class AuthorizationEntity

java.lang.Object
  extended by org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity
All Implemented Interfaces:
Serializable, Authorization, DbEntity, HasDbRevision

public class AuthorizationEntity
extends Object
implements Authorization, DbEntity, HasDbRevision, Serializable

Author:
Daniel Meyer
See Also:
Serialized Form

Field Summary
protected  int authorizationType
           
protected  String groupId
           
protected  String id
           
protected static EnginePersistenceLogger LOG
           
protected  int permissions
           
protected  String resourceId
           
protected  Integer resourceType
           
protected  int revision
           
protected  String userId
           
 
Fields inherited from interface org.camunda.bpm.engine.authorization.Authorization
ANY, AUTH_TYPE_GLOBAL, AUTH_TYPE_GRANT, AUTH_TYPE_REVOKE
 
Constructor Summary
AuthorizationEntity()
           
AuthorizationEntity(int type)
           
 
Method Summary
 void addPermission(Permission p)
          allows granting a permission.
 int getAuthorizationType()
          The type og the authorization.
 String getGroupId()
           
 String getId()
           
 int getPermissions()
           
 Permission[] getPermissions(Permission[] permissions)
          Allows checking whether this authorization grants / revokes a set of permissions.
 Object getPersistentState()
          Returns a representation of the object, as would be stored in the database.
 Integer getResource()
           
 String getResourceId()
           
 int getResourceType()
           
 int getRevision()
           
 int getRevisionNext()
           
 String getUserId()
           
 boolean isEveryPermissionGranted()
          Allows checking whether this authorization grants every single permission.
 boolean isEveryPermissionRevoked()
          Allows checking whether this authorization revokes every single permission.
 boolean isPermissionGranted(Permission p)
          Allows checking whether this authorization grants a specific permission.
 boolean isPermissionRevoked(Permission p)
          Allows checking whether this authorization revokes a specific permission.
 void removePermission(Permission p)
          allows removing a permission.
protected  void resetPermissions()
           
 void setAuthorizationType(int authorizationType)
           
 void setGroupId(String groupId)
          set the id of the group this authorization is created for
 void setId(String id)
           
 void setPermissions(int permissions)
           
 void setPermissions(Permission[] permissions)
          Sets the permissions to the provided value.
 void setResource(Resource resource)
          sets the type of the resource
 void setResourceId(String resourceId)
          set the id of the resource
 void setResourceType(int type)
          sets the type of the resource
 void setRevision(int revision)
           
 void setUserId(String userId)
          set the id of the user this authorization is created for
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final EnginePersistenceLogger LOG

id

protected String id

revision

protected int revision

authorizationType

protected int authorizationType

permissions

protected int permissions

userId

protected String userId

groupId

protected String groupId

resourceType

protected Integer resourceType

resourceId

protected String resourceId
Constructor Detail

AuthorizationEntity

public AuthorizationEntity()

AuthorizationEntity

public AuthorizationEntity(int type)
Method Detail

resetPermissions

protected void resetPermissions()

addPermission

public void addPermission(Permission p)
Description copied from interface: Authorization
allows granting a permission. Out-of-the-box constants can be found in Permissions.

Specified by:
addPermission in interface Authorization

removePermission

public void removePermission(Permission p)
Description copied from interface: Authorization
allows removing a permission. Out-of-the-box constants can be found in Permissions.

Specified by:
removePermission in interface Authorization

isPermissionGranted

public boolean isPermissionGranted(Permission p)
Description copied from interface: Authorization
Allows checking whether this authorization grants a specific permission.

Specified by:
isPermissionGranted in interface Authorization

isPermissionRevoked

public boolean isPermissionRevoked(Permission p)
Description copied from interface: Authorization
Allows checking whether this authorization revokes a specific permission.

Specified by:
isPermissionRevoked in interface Authorization

isEveryPermissionGranted

public boolean isEveryPermissionGranted()
Description copied from interface: Authorization
Allows checking whether this authorization grants every single permission.

Specified by:
isEveryPermissionGranted in interface Authorization
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 interface Authorization
Returns:
true if every single permission is revoked otherwise false

getPermissions

public Permission[] getPermissions(Permission[] permissions)
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:

Specified by:
getPermissions in interface Authorization
Returns:
Returns the set of Permissions provided by this Authorization.

setPermissions

public void setPermissions(Permission[] permissions)
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:

Specified by:
setPermissions in interface Authorization

getAuthorizationType

public int getAuthorizationType()
Description copied from interface: Authorization
The type og the authorization. Legal values:

Specified by:
getAuthorizationType in interface Authorization
Returns:
the type of the authorization.

setAuthorizationType

public void setAuthorizationType(int authorizationType)

getGroupId

public String getGroupId()
Specified by:
getGroupId in interface Authorization
Returns:
the id of the group this authorization is created for

setGroupId

public void setGroupId(String groupId)
Description copied from interface: Authorization
set the id of the group this authorization is created for

Specified by:
setGroupId in interface Authorization

getUserId

public String getUserId()
Specified by:
getUserId in interface Authorization
Returns:
the id of the user this authorization is created for

setUserId

public void setUserId(String userId)
Description copied from interface: Authorization
set the id of the user this authorization is created for

Specified by:
setUserId in interface Authorization

getResourceType

public int getResourceType()
Specified by:
getResourceType in interface Authorization
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 interface Authorization

getResource

public Integer getResource()

setResource

public void setResource(Resource resource)
Description copied from interface: Authorization
sets the type of the resource

Specified by:
setResource in interface Authorization

getResourceId

public String getResourceId()
Specified by:
getResourceId in interface Authorization
Returns:
the id of the resource

setResourceId

public void setResourceId(String resourceId)
Description copied from interface: Authorization
set the id of the resource

Specified by:
setResourceId in interface Authorization

getId

public String getId()
Specified by:
getId in interface Authorization
Specified by:
getId in interface DbEntity
Returns:
the ID of the Authorization object

setId

public void setId(String id)
Specified by:
setId in interface DbEntity

getRevision

public int getRevision()
Specified by:
getRevision in interface HasDbRevision

setRevision

public void setRevision(int revision)
Specified by:
setRevision in interface HasDbRevision

setPermissions

public void setPermissions(int permissions)

getPermissions

public int getPermissions()

getRevisionNext

public int getRevisionNext()
Specified by:
getRevisionNext in interface HasDbRevision

getPersistentState

public Object 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 interface DbEntity

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2017 camunda services GmbH. All rights reserved.