org.camunda.bpm.engine.impl
Class AuthorizationQueryImpl

java.lang.Object
  extended by org.camunda.bpm.engine.impl.db.AuthorizationCheck
      extended by org.camunda.bpm.engine.impl.db.ListQueryParameterObject
          extended by org.camunda.bpm.engine.impl.AbstractQuery<AuthorizationQuery,Authorization>
              extended by org.camunda.bpm.engine.impl.AuthorizationQueryImpl
All Implemented Interfaces:
Serializable, AuthorizationQuery, Command<Object>, Query<AuthorizationQuery,Authorization>

public class AuthorizationQueryImpl
extends AbstractQuery<AuthorizationQuery,Authorization>
implements AuthorizationQuery

Author:
Daniel Meyer
See Also:
Serialized Form

Field Summary
protected  Integer authorizationType
           
protected  String[] groupIds
           
protected  String id
           
protected  int permission
           
protected  boolean queryByPermission
           
protected  boolean queryByResourceType
           
protected  String resourceId
           
protected  int resourceType
           
protected  String[] userIds
           
 
Fields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandContext, commandExecutor, expressions, orderingProperties, resultType, SORTORDER_ASC, SORTORDER_DESC
 
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
databaseType, DEFAULT_ORDER_BY, firstResult, maxResults, orderBy, parameter
 
Fields inherited from class org.camunda.bpm.engine.impl.db.AuthorizationCheck
authDefaultPerm, authGroupIds, authUserId, isAuthorizationCheckEnabled, permissionChecks
 
Constructor Summary
AuthorizationQueryImpl(CommandContext commandContext)
           
AuthorizationQueryImpl(CommandExecutor commandExecutor)
           
 
Method Summary
 AuthorizationQuery authorizationId(String id)
          only selects authorizations for the given id
 AuthorizationQuery authorizationType(Integer type)
          only selects authorizations for the given type.
 long executeCount(CommandContext commandContext)
           
 List<Authorization> executeList(CommandContext commandContext, Page page)
          Executes the actual query to retrieve the list of results.
 String[] getGroupIds()
           
 String getId()
           
 int getPermission()
           
 String getResourceId()
           
 int getResourceType()
           
 String[] getUserIds()
           
 AuthorizationQuery groupIdIn(String... groupIdIn)
          only selects authorizations for the given group ids
 AuthorizationQuery hasPermission(Permission p)
          only selects authorizations which grant the permissions represented by the parameter.
 boolean isQueryByPermission()
           
 boolean isQueryByResourceType()
           
 AuthorizationQuery orderByResourceId()
          Order by resource id (needs to be followed by Query.asc() or Query.desc()).
 AuthorizationQuery orderByResourceType()
          Order by resource type (needs to be followed by Query.asc() or Query.desc()).
 AuthorizationQuery resourceId(String resourceId)
          only selects authorizations for the given resource id
 AuthorizationQuery resourceType(int resourceType)
          only selects authorizations for the given resource type
 AuthorizationQuery resourceType(Resource resource)
          only selects authorizations for the given resource type
 AuthorizationQuery userIdIn(String... userIdIn)
          only selects authorizations for the given user ids
 
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, asc, checkQueryOk, count, desc, direction, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteList, execute, executeSingleResult, extend, getExpressions, getMethod, getOrderBy, getOrderingProperties, list, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, setCommandExecutor, setExpressions, setOrderingProperties, singleResult
 
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getParameter, setDatabaseType, setFirstResult, setMaxResults, setOrderBy, setParameter
 
Methods inherited from class org.camunda.bpm.engine.impl.db.AuthorizationCheck
addPermissionCheck, getAuthDefaultPerm, getAuthGroupIds, getAuthUserId, getPermissionChecks, isAuthorizationCheckEnabled, setAuthDefaultPerm, setAuthGroupIds, setAuthorizationCheckEnabled, setAuthUserId, setPermissionChecks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult
 

Field Detail

id

protected String id

userIds

protected String[] userIds

groupIds

protected String[] groupIds

resourceType

protected int resourceType

resourceId

protected String resourceId

permission

protected int permission

authorizationType

protected Integer authorizationType

queryByPermission

protected boolean queryByPermission

queryByResourceType

protected boolean queryByResourceType
Constructor Detail

AuthorizationQueryImpl

public AuthorizationQueryImpl(CommandExecutor commandExecutor)

AuthorizationQueryImpl

public AuthorizationQueryImpl(CommandContext commandContext)
Method Detail

authorizationId

public AuthorizationQuery authorizationId(String id)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given id

Specified by:
authorizationId in interface AuthorizationQuery

userIdIn

public AuthorizationQuery userIdIn(String... userIdIn)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given user ids

Specified by:
userIdIn in interface AuthorizationQuery

groupIdIn

public AuthorizationQuery groupIdIn(String... groupIdIn)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given group ids

Specified by:
groupIdIn in interface AuthorizationQuery

resourceType

public AuthorizationQuery resourceType(Resource resource)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given resource type

Specified by:
resourceType in interface AuthorizationQuery

resourceType

public AuthorizationQuery resourceType(int resourceType)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given resource type

Specified by:
resourceType in interface AuthorizationQuery

resourceId

public AuthorizationQuery resourceId(String resourceId)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given resource id

Specified by:
resourceId in interface AuthorizationQuery

hasPermission

public AuthorizationQuery hasPermission(Permission p)
Description copied from interface: AuthorizationQuery
only selects authorizations which grant the permissions represented by the parameter. If this method is called multiple times, all passed-in permissions will be checked with AND semantics. Example:
 authorizationQuery.userId("user1")
   .resourceType("processDefinition")
   .resourceId("2313")
   .hasPermission(Permissions.READ)
   .hasPermission(Permissions.WRITE)
   .hasPermission(Permissions.DELETE)
   .list();
 
Selects all Authorization objects which provide READ,WRITE,DELETE Permissions for the given user.

Specified by:
hasPermission in interface AuthorizationQuery

authorizationType

public AuthorizationQuery authorizationType(Integer type)
Description copied from interface: AuthorizationQuery
only selects authorizations for the given type. Legal values: Authorization.AUTH_TYPE_GLOBAL, Authorization.AUTH_TYPE_GRANT Authorization.AUTH_TYPE_REVOKE

Specified by:
authorizationType in interface AuthorizationQuery

executeCount

public long executeCount(CommandContext commandContext)
Specified by:
executeCount in class AbstractQuery<AuthorizationQuery,Authorization>

executeList

public List<Authorization> executeList(CommandContext commandContext,
                                       Page page)
Description copied from class: AbstractQuery
Executes the actual query to retrieve the list of results.

Specified by:
executeList in class AbstractQuery<AuthorizationQuery,Authorization>
page - used if the results must be paged. If null, no paging will be applied.

getId

public String getId()

isQueryByPermission

public boolean isQueryByPermission()

getUserIds

public String[] getUserIds()

getGroupIds

public String[] getGroupIds()

getResourceType

public int getResourceType()

getResourceId

public String getResourceId()

getPermission

public int getPermission()

isQueryByResourceType

public boolean isQueryByResourceType()

orderByResourceType

public AuthorizationQuery orderByResourceType()
Description copied from interface: AuthorizationQuery
Order by resource type (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByResourceType in interface AuthorizationQuery

orderByResourceId

public AuthorizationQuery orderByResourceId()
Description copied from interface: AuthorizationQuery
Order by resource id (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByResourceId in interface AuthorizationQuery


Copyright © 2015 camunda services GmbH. All rights reserved.