public class AuthorizationQueryImpl extends AbstractQuery<AuthorizationQuery,Authorization> implements AuthorizationQuery
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 |
commandContext, commandExecutor, orderBy, orderProperty, resultType, SORTORDER_ASC, SORTORDER_DESC
databaseType, firstResult, maxResults, parameter
authDefaultPerm, authGroupIds, authPerms, authResourceId, authResourceIdQueryParam, authResourceType, authUserId, isAuthorizationCheckEnabled
Constructor and Description |
---|
AuthorizationQueryImpl(CommandContext commandContext) |
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
|
addOrder, asc, assertParamNotNull, assertParamNotNull, checkQueryOk, count, desc, direction, execute, executeSingleResult, getOrderBy, list, listPage, orderBy, setCommandExecutor, singleResult
getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getParameter, setDatabaseType, setFirstResult, setMaxResults, setOrderBy, setParameter
getAuthDefaultPerm, getAuthGroupIds, getAuthPerms, getAuthResourceId, getAuthResourceIdQueryParam, getAuthResourceType, getAuthUserId, isAuthorizationCheckEnabled, setAuthDefaultPerm, setAuthGroupIds, setAuthorizationCheckEnabled, setAuthPerms, setAuthResourceId, setAuthResourceIdQueryParam, setAuthResourceType, setAuthUserId
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(CommandExecutor commandExecutor)
public AuthorizationQueryImpl(CommandContext commandContext)
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 © 2015. All rights reserved.