Class ProjectRoleAndGroupPermissionsQueryDecorator

java.lang.Object
com.atlassian.jira.search.jql.ProjectRoleAndGroupPermissionsQueryDecorator

public class ProjectRoleAndGroupPermissionsQueryDecorator extends Object
  • Constructor Details

  • 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 creation
      groupLevelField - the name of the index field which represents the group level visibility
      roleLevelField - 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 query
      queryCreationContext - 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 query
      queryCreationContext - 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 creation
      groupLevelField - the name of the index field which represents the group level visibility
      roleLevelField - 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