public class

UserCF

extends AbstractIssueFieldSecurityType
java.lang.Object
   ↳ com.atlassian.jira.security.type.AbstractSecurityType
     ↳ com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
       ↳ com.atlassian.jira.security.type.UserCF

Class Overview

Issue Security and Permission type for a User Selector custom field, or select-list custom fields which specify users.

Summary

Constants
String TYPE
Public Constructors
UserCF(JiraAuthenticationContext jiraAuthenticationContext, CustomFieldManager customFieldManager)
Public Methods
void doValidation(String key, Map<StringString> parameters, JiraServiceContext jiraServiceContext)
String getArgumentDisplay(String argument)
List<Field> getDisplayFields()
String getDisplayName()
String getType()
Set<User> getUsers(PermissionContext ctx, String customFieldId)
Get user specified by the Custom Field
Protected Methods
String getFieldName(String parameter)
Get the field name for this Issue Field-based Security Type given the parameter in the saved configuration.
boolean hasIssuePermission(User user, boolean issueCreation, Issue issue, String parameter)
boolean hasIssuePermission(User user, boolean issueCreation, GenericValue issueGv, String customFieldName)
Defines whether the given user has permission to see the given issue using the issue's value of the named custom field.
boolean hasProjectPermission(User user, boolean issueCreation, GenericValue project)
boolean hasProjectPermission(User user, boolean issueCreation, Project project)
[Expand]
Inherited Methods
From class com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
From class com.atlassian.jira.security.type.AbstractSecurityType
From class java.lang.Object
From interface com.atlassian.jira.scheme.SchemeType
From interface com.atlassian.jira.security.type.SecurityType

Constants

public static final String TYPE

Constant Value: "userCF"

Public Constructors

public UserCF (JiraAuthenticationContext jiraAuthenticationContext, CustomFieldManager customFieldManager)

Public Methods

public void doValidation (String key, Map<StringString> parameters, JiraServiceContext jiraServiceContext)

public String getArgumentDisplay (String argument)

public List<Field> getDisplayFields ()

public String getDisplayName ()

public String getType ()

public Set<User> getUsers (PermissionContext ctx, String customFieldId)

Get user specified by the Custom Field

Parameters
ctx permission context
customFieldId eg. 'customfield_10000'
Returns
  • the set of users stored in the given custom field in the given context; an empty set is returned if the context could not provide values (i.e. there was no issue specified).

Protected Methods

protected String getFieldName (String parameter)

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.

Parameters
parameter the parameter as saved in the config
Returns
  • the field name for this Issue Field-based Security Type.

protected boolean hasIssuePermission (User user, boolean issueCreation, Issue issue, String parameter)

protected boolean hasIssuePermission (User user, boolean issueCreation, GenericValue issueGv, String customFieldName)

Defines whether the given user has permission to see the given issue using the issue's value of the named custom field.

Parameters
user the user whose permission is being checked.
issueCreation unused.
issueGv a GenericValue representing the issue.
customFieldName user custom field to use to determine which users have permission to the issue.
Returns
  • true only if the user has permission to see the issue based on the custom field value.

protected boolean hasProjectPermission (User user, boolean issueCreation, GenericValue project)

protected boolean hasProjectPermission (User user, boolean issueCreation, Project project)