Package com.atlassian.jira.security.type
Class CurrentAssigneeHasAssignablePermission
java.lang.Object
com.atlassian.jira.security.type.AbstractSecurityType
com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
com.atlassian.jira.security.type.SimpleIssueFieldSecurityType
com.atlassian.jira.security.type.CurrentAssigneeHasAssignablePermission
- All Implemented Interfaces:
SchemeType
,SecurityType
-
Constructor Summary
ConstructorsConstructorDescriptionCurrentAssigneeHasAssignablePermission
(JiraAuthenticationContext jiraAuthenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
doValidation
(String key, Map parameters, JiraServiceContext jiraServiceContext) protected String
getField()
protected String
getFieldName
(String parameter) Get the field name for this Issue Field-based Security Type given the parameter in the saved configuration.protected String
getFieldValue
(Issue issue) Returns the user key value for the given issue for the field that this security type checks.getType()
getUsers
(PermissionContext ctx, String ignored) Returns a set ofApplicationUser
s represented by a security type instance.getUsers
(PermissionContext ctx, String ignored, String userSearchName, int limit) Returns a set ofApplicationUser
s represented by a security type instance optionally filtered by given userSearchName.protected boolean
hasProjectPermission
(ApplicationUser user, boolean issueCreation, Project project) boolean
isValidForPermission
(ProjectPermissionKey permissionKey) Is valid for all permissions except "Assignable".Methods inherited from class com.atlassian.jira.security.type.SimpleIssueFieldSecurityType
hasIssuePermission
Methods inherited from class com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
getPermissionFieldContents, getPermissionFieldContents, getPermissionFieldContentsForProject, getPermissionFieldContentsForSecurityLevel, hasPermission, hasPermission, hasPermission, hasPermission, isTopLevelIssueSecurityPermission, isTopLevelProjectPermission
Methods inherited from class com.atlassian.jira.security.type.AbstractSecurityType
getArgumentDisplay
-
Constructor Details
-
CurrentAssigneeHasAssignablePermission
-
-
Method Details
-
getDisplayName
-
getType
-
doValidation
-
getFieldName
Description copied from class:AbstractIssueFieldSecurityType
Get 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:
getFieldName
in classAbstractIssueFieldSecurityType
- Parameters:
parameter
- the parameter as saved in the config- Returns:
- the field name for this Issue Field-based Security Type.
-
isValidForPermission
Is valid for all permissions except "Assignable".Because we rely on the permissions for the "Assignable" function, then not only does it not make sense to add this role to "Assignable", it would actually cause an infinite loop. see JRA-13315
- Specified by:
isValidForPermission
in interfaceSchemeType
- Overrides:
isValidForPermission
in classAbstractSecurityType
- Parameters:
permissionKey
- permission key.- Returns:
- false for Permissions.ASSIGNABLE_USER, true otherwise.
- See Also:
-
hasProjectPermission
protected boolean hasProjectPermission(ApplicationUser user, boolean issueCreation, Project project) - Specified by:
hasProjectPermission
in classAbstractIssueFieldSecurityType
-
getField
- Specified by:
getField
in classSimpleIssueFieldSecurityType
-
getUsers
Description copied from interface:SecurityType
Returns a set ofApplicationUser
s represented by a security type instance. The collection must not contain any nulls.- Parameters:
ctx
- The current issue and projectignored
- Instance value, eg. a group name, user name, custom field id- Returns:
- A set of
ApplicationUser
s.
-
getUsers
@Nonnull public Set<ApplicationUser> getUsers(@Nonnull PermissionContext ctx, @Nullable String ignored, @Nonnull String userSearchName, int limit) Description copied from interface:SecurityType
Returns a set ofApplicationUser
s represented by a security type instance optionally filtered by given userSearchName.The implementation must be as performant as possible and return users sorted by lowercase display name, then lowercase username.
The default implementation is provided only not to break existing implementations and should be avoided at all cost.
- Parameters:
ctx
- the context this method is called in; contains issue and projectignored
- instance value, e.g. group name, username, custom field iduserSearchName
- query for user name; may be blanklimit
- maximum number of users to return
-
getFieldValue
Description copied from class:SimpleIssueFieldSecurityType
Returns the user key value for the given issue for the field that this security type checks.- Specified by:
getFieldValue
in classSimpleIssueFieldSecurityType
- Parameters:
issue
- the Issue- Returns:
- the user key value for the given issue for the field that this security type checks.
-