Package com.atlassian.jira.security.type
Class GroupCF
java.lang.Object
com.atlassian.jira.security.type.AbstractSecurityType
com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
com.atlassian.jira.security.type.GroupCF
- All Implemented Interfaces:
SchemeType,SecurityType
Issue Security and Permission type for a Group Selector custom field, or select-list custom fields which specify groups.
- Since:
- 3.6
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGroupCF(JiraAuthenticationContext jiraAuthenticationContext, GroupSelectorUtils groupSelectorUtils, CustomFieldManager customFieldManager, GroupManager groupManager) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoValidation(String key, Map<String, String> parameters, JiraServiceContext jiraServiceContext) getArgumentDisplay(String argument) protected StringgetFieldName(String parameter) Get the field name for this Issue Field-based Security Type given the parameter in the saved configuration.protected Set<org.apache.lucene.util.BytesRef>getPermissionFieldContentsForProject(Project project, ApplicationUser searcher, String fieldName) Gets called to produce the Lucene query for a projectprotected Set<org.apache.lucene.util.BytesRef>getPermissionFieldContentsForSecurityLevel(IssueSecurityLevel issueSecurity, ApplicationUser searcher, String fieldName) Produces a Lucene query for a given issue security type such that documents match the query only when the given user is defined for the issue by this custom field in the given security.getType()getUsers(PermissionContext ctx, String customFieldId) Get user specified by the Custom Fieldprotected booleanhasIssuePermission(ApplicationUser user, boolean issueCreation, Issue issue, String parameter) protected booleanhasProjectPermission(ApplicationUser user, boolean issueCreation, Project project) Methods inherited from class com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
getPermissionFieldContents, getPermissionFieldContents, hasPermission, hasPermission, hasPermission, hasPermission, isTopLevelIssueSecurityPermission, isTopLevelProjectPermissionMethods inherited from class com.atlassian.jira.security.type.AbstractSecurityType
isValidForPermissionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.security.type.SecurityType
getUsers
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
GroupCF
public GroupCF(JiraAuthenticationContext jiraAuthenticationContext, GroupSelectorUtils groupSelectorUtils, CustomFieldManager customFieldManager, GroupManager groupManager)
-
-
Method Details
-
getDisplayName
-
getType
-
getPermissionFieldContentsForProject
@Nullable protected Set<org.apache.lucene.util.BytesRef> getPermissionFieldContentsForProject(@Nonnull Project project, @Nullable ApplicationUser searcher, @Nonnull String fieldName) Description copied from class:AbstractIssueFieldSecurityTypeGets called to produce the Lucene query for a project- Overrides:
getPermissionFieldContentsForProjectin classAbstractIssueFieldSecurityType- Parameters:
project- The project for which to construct a querysearcher- The user who is searching to add to the query- Returns:
- A BooleanQuery with the project and searcher terms, or
nullif the searcher is eithernullor not a known user
-
getPermissionFieldContentsForSecurityLevel
protected Set<org.apache.lucene.util.BytesRef> getPermissionFieldContentsForSecurityLevel(IssueSecurityLevel issueSecurity, ApplicationUser searcher, String fieldName) Description copied from class:AbstractIssueFieldSecurityTypeProduces a Lucene query for a given issue security type such that documents match the query only when the given user is defined for the issue by this custom field in the given security.- Overrides:
getPermissionFieldContentsForSecurityLevelin classAbstractIssueFieldSecurityType- Parameters:
issueSecurity- the security defined by this IssueFieldSecurityType instance.searcher- the user.- Returns:
- a query to constrain to the given issue security for the given user or
nullif user is eithernullor not a known user
-
doValidation
public void doValidation(String key, Map<String, String> parameters, JiraServiceContext jiraServiceContext) -
getFieldName
Description copied from class:AbstractIssueFieldSecurityTypeGet the field name for this Issue Field-based Security Type given the parameter in the saved configuration.Some Field based permissions are based on hard-coded fields like assignee and reporter in which case the parameter is not used. Other types use the parameter to name the particular User or Group custom field that is used for the permission.
- Specified by:
getFieldNamein classAbstractIssueFieldSecurityType- Parameters:
parameter- the parameter as saved in the config- Returns:
- the field name for this Issue Field-based Security Type.
-
hasProjectPermission
protected boolean hasProjectPermission(ApplicationUser user, boolean issueCreation, Project project) - Specified by:
hasProjectPermissionin classAbstractIssueFieldSecurityType
-
hasIssuePermission
protected boolean hasIssuePermission(ApplicationUser user, boolean issueCreation, Issue issue, String parameter) - Specified by:
hasIssuePermissionin classAbstractIssueFieldSecurityType
-
getDisplayFields
-
getArgumentDisplay
- Specified by:
getArgumentDisplayin interfaceSecurityType- Overrides:
getArgumentDisplayin classAbstractSecurityType
-
getUsers
Get user specified by the Custom Field- Parameters:
customFieldId- eg. 'customfield_10000'ctx- The current issue and project- Returns:
- A set of
ApplicationUsers.
-