Package com.atlassian.jira.issue.index
Class SecurityIndexingUtils
java.lang.Object
com.atlassian.jira.issue.index.SecurityIndexingUtils
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)
indexPermissions(Document, Issue, String, String)
.- Since:
- 8.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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
generateProjectPermissionFieldContents
(Long projectId) 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.
-
Constructor Details
-
SecurityIndexingUtils
public SecurityIndexingUtils()
-
-
Method Details
-
indexPermissions
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 addedissue
- 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 addedissue
- Issue that is indexed in the documentfieldName
- The name of the field that is being indexedfieldValue
- 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 contentfieldName
- Field name for which we generate permission field contentfieldValue
- 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 contentprojectId
- 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 contentfieldName
- Field name for which we generate permission field contentfieldValue
- Value of the field for which we generate permission field content- Returns:
-