Class SecurityIndexingUtils

java.lang.Object
com.atlassian.jira.issue.index.SecurityIndexingUtils

@Internal public class SecurityIndexingUtils extends Object
Set of utility methods for indexing and querying project and issue security permissions. Permissions can be based on a combination of
  • project id
  • project id + field (name + value)
  • issue security level id
  • issue security level id + project id
  • issue security level id + field (name + value)
Each field which can be used in project security scheme or issue security scheme (i.e. one that is a user or group field) has to be indexed with indexPermissions(Document, Issue, String, String).
Since:
8.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.lucene.util.BytesRef
    Generate query string that corresponds to a issue security level permission that is satisfied by the issue security level.
    static org.apache.lucene.util.BytesRef
    generateIssueLevelPermissionContents(Long issueSecurityLevel, Long projectId)
    Generate query string that corresponds to a issue security level permission that is satisfied by the issue security level in the project.
    static org.apache.lucene.util.BytesRef
    generateIssueLevelPermissionContents(Long issueSecurityLevel, String fieldName, String fieldValue)
    Generate query string that corresponds to a issue security level permission that is satisfied by a concrete value of a concrete field.
    static org.apache.lucene.util.BytesRef
    Generate query string that corresponds to a project permission that is satisfied by the project.
    static org.apache.lucene.util.BytesRef
    generateProjectPermissionFieldContents(Long projectId, String fieldName, String fieldValue)
    Generate query string that corresponds to a project permission that is satisfied by a concrete value of a concrete field.
    static void
    indexPermissions(org.apache.lucene.document.Document doc, Issue issue)
    Index top level permissions - ones that depend only on the project and issue security level and not on a specific field value.
    static void
    indexPermissions(org.apache.lucene.document.Document doc, Issue issue, String fieldName, String fieldValue)
    Index field level permissions - ones that depend on specific field value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SecurityIndexingUtils

      public SecurityIndexingUtils()
  • Method Details

    • indexPermissions

      public static void indexPermissions(org.apache.lucene.document.Document doc, Issue issue)
      Index top level permissions - ones that depend only on the project and issue security level and not on a specific field value. For example "project lead" is satisfied for all issues in a given project, regardless of the issues' values.
      Parameters:
      doc - Document to which the indexed field will be added
      issue - Issue that is indexed in the document
    • indexPermissions

      public static void indexPermissions(org.apache.lucene.document.Document doc, Issue issue, String fieldName, String fieldValue)
      Index field level permissions - ones that depend on specific field value. For example "assignee" is satisfied only by issues which have the assignee field set to the current searcher.
      Parameters:
      doc - Document to which the indexed field will be added
      issue - Issue that is indexed in the document
      fieldName - The name of the field that is being indexed
      fieldValue - The value of the field that is being indexed
    • generateProjectPermissionFieldContents

      public static org.apache.lucene.util.BytesRef generateProjectPermissionFieldContents(Long projectId)
      Generate query string that corresponds to a project permission that is satisfied by the project.
      Parameters:
      projectId - Id of the project for which we generate permission field content
      Returns:
      Permission field content for the project id
    • generateProjectPermissionFieldContents

      public static org.apache.lucene.util.BytesRef generateProjectPermissionFieldContents(Long projectId, String fieldName, String fieldValue)
      Generate query string that corresponds to a project permission that is satisfied by a concrete value of a concrete field.
      Parameters:
      projectId - Id of the project for which we generate field content
      fieldName - Field name for which we generate permission field content
      fieldValue - Value of the field for which we generate permission field content
      Returns:
      Permission field content for the value of the field in the specified project
    • generateIssueLevelPermissionContents

      public static org.apache.lucene.util.BytesRef generateIssueLevelPermissionContents(Long issueSecurityLevel)
      Generate query string that corresponds to a issue security level permission that is satisfied by the issue security level.
      Parameters:
      issueSecurityLevel - Id of the issue security level for which we generate field content
      Returns:
      Permission field content for the issue security level
    • generateIssueLevelPermissionContents

      public static org.apache.lucene.util.BytesRef generateIssueLevelPermissionContents(Long issueSecurityLevel, Long projectId)
      Generate query string that corresponds to a issue security level permission that is satisfied by the issue security level in the project.
      Parameters:
      issueSecurityLevel - Id of the issue security level for which we generate field content
      projectId - Id of the project for which we generate field content
      Returns:
      Permission field content for the issue security level and project
    • generateIssueLevelPermissionContents

      public static org.apache.lucene.util.BytesRef generateIssueLevelPermissionContents(Long issueSecurityLevel, String fieldName, String fieldValue)
      Generate query string that corresponds to a issue security level permission that is satisfied by a concrete value of a concrete field.
      Parameters:
      issueSecurityLevel - Id of the issue security level for which we generate field content
      fieldName - Field name for which we generate permission field content
      fieldValue - Value of the field for which we generate permission field content
      Returns: