public class

QueryProjectRoleAndGroupPermissionsDecorator

extends Object
java.lang.Object
   ↳ com.atlassian.jira.jql.query.QueryProjectRoleAndGroupPermissionsDecorator

Class Overview

A component that can add project role and group permission checks to lucene queries.

Summary

Fields
public static final BooleanQuery matchNoDocsQuery
Public Constructors
QueryProjectRoleAndGroupPermissionsDecorator(PermissionManager permissionManager, ProjectRoleManager projectRoleManager)
Public Methods
Query appendPermissionFilterQuery(Query query, QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField)
Append the permission query to the passed query.
Query createPermissionQuery(QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField)
Creates the lucene 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.
Query decorateWorklogQueryWithPermissionChecks(Query query, QueryCreationContext queryCreationContext)
Takes a worklog index query and adds some necessary permission checks to it.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final BooleanQuery matchNoDocsQuery

Public Constructors

public QueryProjectRoleAndGroupPermissionsDecorator (PermissionManager permissionManager, ProjectRoleManager projectRoleManager)

Public Methods

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 creation
groupLevelField the name of the lucene document field which represents the group level visibility
roleLevelField the name of the lucene document field which represents the role level visibility
Returns
  • the lucene query combined from passed query and permission query

public Query createPermissionQuery (QueryCreationContext queryCreationContext, String groupLevelField, String roleLevelField)

Creates the lucene 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 creation
groupLevelField the name of the lucene document field which represents the group level visibility
roleLevelField the name of the lucene document 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

public Query decorateWorklogQueryWithPermissionChecks (Query query, QueryCreationContext queryCreationContext)

Takes a worklog index query and adds some necessary permission checks to it.

Parameters
query worklog query
queryCreationContext query context
Returns
  • a new query with permission checks added