public class AuthorizationQueryImpl extends AbstractQuery<AuthorizationQuery,Authorization> implements AuthorizationQuery
AbstractQuery.ResultType
Modifier and Type | Field and Description |
---|---|
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 |
commandExecutor, expressions, resultType, SORTORDER_ASC, SORTORDER_DESC, validators
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
Constructor and Description |
---|
AuthorizationQueryImpl() |
AuthorizationQueryImpl(CommandExecutor commandExecutor) |
Modifier and Type | Method and Description |
---|---|
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
|
addExpression, addValidator, asc, checkQueryOk, count, desc, direction, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteIdsList, evaluateExpressionsAndExecuteList, execute, executeIdsList, executeSingleResult, extend, getExpressions, getMethod, hasExcludingConditions, list, listIds, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, removeValidator, setCommandExecutor, setExpressions, singleResult, validate, validate
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderingProperties, setParameter, setTenantCheck
protected String id
protected String[] userIds
protected String[] groupIds
protected int resourceType
protected String resourceId
protected int permission
protected Integer authorizationType
protected boolean queryByPermission
protected boolean queryByResourceType
public AuthorizationQueryImpl()
public AuthorizationQueryImpl(CommandExecutor commandExecutor)
public AuthorizationQuery authorizationId(String id)
AuthorizationQuery
authorizationId
in interface AuthorizationQuery
public AuthorizationQuery userIdIn(String... userIdIn)
AuthorizationQuery
userIdIn
in interface AuthorizationQuery
public AuthorizationQuery groupIdIn(String... groupIdIn)
AuthorizationQuery
groupIdIn
in interface AuthorizationQuery
public AuthorizationQuery resourceType(Resource resource)
AuthorizationQuery
resourceType
in interface AuthorizationQuery
public AuthorizationQuery resourceType(int resourceType)
AuthorizationQuery
resourceType
in interface AuthorizationQuery
public AuthorizationQuery resourceId(String resourceId)
AuthorizationQuery
resourceId
in interface AuthorizationQuery
public AuthorizationQuery hasPermission(Permission p)
AuthorizationQuery
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.
hasPermission
in interface AuthorizationQuery
public AuthorizationQuery authorizationType(Integer type)
AuthorizationQuery
Authorization.AUTH_TYPE_GLOBAL
, Authorization.AUTH_TYPE_GRANT
Authorization.AUTH_TYPE_REVOKE
authorizationType
in interface AuthorizationQuery
public long executeCount(CommandContext commandContext)
executeCount
in class AbstractQuery<AuthorizationQuery,Authorization>
public List<Authorization> executeList(CommandContext commandContext, Page page)
AbstractQuery
executeList
in class AbstractQuery<AuthorizationQuery,Authorization>
page
- used if the results must be paged. If null, no paging will be applied.public String getId()
public boolean isQueryByPermission()
public String[] getUserIds()
public String[] getGroupIds()
public int getResourceType()
public String getResourceId()
public int getPermission()
public boolean isQueryByResourceType()
public AuthorizationQuery orderByResourceType()
AuthorizationQuery
Query.asc()
or Query.desc()
).orderByResourceType
in interface AuthorizationQuery
public AuthorizationQuery orderByResourceId()
AuthorizationQuery
Query.asc()
or Query.desc()
).orderByResourceId
in interface AuthorizationQuery
Copyright © 2018. All rights reserved.