Package com.atlassian.jira.search.jql
Class ProjectRoleAndGroupPermissionsQueryDecorator
java.lang.Object
com.atlassian.jira.search.jql.ProjectRoleAndGroupPermissionsQueryDecorator
-
Constructor Summary
ConstructorsConstructorDescriptionProjectRoleAndGroupPermissionsQueryDecorator(PermissionManager permissionManager, ProjectRoleManager projectRoleManager, UserUtil userUtil) -
Method Summary
Modifier and TypeMethodDescriptionappendPermissionFilterQuery(Query query, QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField) Append the permission query to the passed query.createPermissionQuery(QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField) Creates the search query that will restrict the results to only elements that are visible to the user based on the query creation context and elements' group and role visibility levels.decorateCommentQueryWithPermissionChecks(Query query, QueryCreationContext queryCreationContext) Takes a comment index query and adds some necessary permission checks to it.decorateWorklogQueryWithPermissionChecks(Query query, QueryCreationContext queryCreationContext) Takes a worklog index query and adds some necessary permission checks to it.
-
Constructor Details
-
ProjectRoleAndGroupPermissionsQueryDecorator
public ProjectRoleAndGroupPermissionsQueryDecorator(PermissionManager permissionManager, ProjectRoleManager projectRoleManager, UserUtil userUtil)
-
-
Method Details
-
appendPermissionFilterQuery
public Query appendPermissionFilterQuery(Query query, QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField) Append the permission query to the passed query.- Parameters:
queryCreationContext- the context of query creationgroupLevelField- the name of the index field which represents the group level visibilityroleLevelField- the name of the index field which represents the role level visibility- Returns:
- the search query combined from passed query and permission query
-
decorateWorklogQueryWithPermissionChecks
public Query decorateWorklogQueryWithPermissionChecks(Query query, QueryCreationContext queryCreationContext) Takes a worklog index query and adds some necessary permission checks to it.- Parameters:
query- worklog queryqueryCreationContext- query context- Returns:
- a new query with permission checks added
-
decorateCommentQueryWithPermissionChecks
public Query decorateCommentQueryWithPermissionChecks(Query query, QueryCreationContext queryCreationContext) Takes a comment index query and adds some necessary permission checks to it.- Parameters:
query- comment queryqueryCreationContext- query context- Returns:
- a new query with permission checks added
-
createPermissionQuery
public Query createPermissionQuery(QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField) Creates the search query that will restrict the results to only elements that are visible to the user based on the query creation context and elements' group and role visibility levels.- Parameters:
queryCreationContext- the context of query creationgroupLevelField- the name of the index field which represents the group level visibilityroleLevelField- the name of the index field which represents the role level visibility- Returns:
- the query with all conditions to filter restricted items. Return empty BooleanQuery if user has no rights to see any project. Return MatchAllDocsQuery query if security is overriden
-