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(FieldValueCollector, Issue, String, String).- Since:
- 8.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateIssueLevelPermissionContentString(Long issueSecurityLevel) Generate a queryStringthat corresponds to an issue security level permission that is satisfied by the issue security level.static StringgenerateIssueLevelPermissionContentString(Long issueSecurityLevel, Long projectId) Generate a queryStringthat corresponds to an issue security level permission that is satisfied by the issue security level in the project.static StringgenerateIssueLevelPermissionContentString(Long issueSecurityLevel, String fieldName, String fieldValue) Generate a queryStringthat corresponds to an issue security level permission that is satisfied by a concrete value of a concrete field.static StringgenerateProjectPermissionFieldContentString(Long projectId) Generate a queryStringthat corresponds to a project permission that is satisfied by the project.static StringgenerateProjectPermissionFieldContentString(Long projectId, String fieldName, String fieldValue) Generate a queryStringthat corresponds to a project permission that is satisfied by a concrete value of a concrete field.static voidindexPermissions(FieldValueCollector collector, 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 voidindexPermissions(FieldValueCollector collector, 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:
collector-FieldValueCollectorto which the indexed field will be addedissue- Issue that is indexed in the document
-
indexPermissions
public static void indexPermissions(FieldValueCollector collector, 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:
collector-FieldValueCollectorto 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
-
generateProjectPermissionFieldContentString
Generate a queryStringthat 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 as a
String
-
generateProjectPermissionFieldContentString
public static String generateProjectPermissionFieldContentString(Long projectId, String fieldName, String fieldValue) Generate a queryStringthat 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 as a
String
-
generateIssueLevelPermissionContentString
Generate a queryStringthat corresponds to an 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 as a
String
-
generateIssueLevelPermissionContentString
public static String generateIssueLevelPermissionContentString(Long issueSecurityLevel, Long projectId) Generate a queryStringthat corresponds to an 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 as a
String
-
generateIssueLevelPermissionContentString
public static String generateIssueLevelPermissionContentString(Long issueSecurityLevel, String fieldName, String fieldValue) Generate a queryStringthat corresponds to an 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:
- Permission field content for the issue security level, field name and value as a
String
-