public class

GroupCF

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

Class Overview

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

Summary

Constants
String TYPE
Public Constructors
GroupCF(JiraAuthenticationContext jiraAuthenticationContext, GroupSelectorUtils groupSelectorUtils, CustomFieldManager customFieldManager, GroupManager groupManager)
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.
BooleanQuery getQueryForProject(Project project, User searcher, String fieldName)
Gets called to produce the Lucene query for a project
BooleanQuery getQueryForSecurityLevel(IssueSecurityLevel issueSecurity, User 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.
boolean hasIssuePermission(User user, boolean issueCreation, GenericValue issueGv, String customFieldName)
Determines if the given user has permission to see the given issue by using the custom field with the given custom field name to look up a group.
boolean hasIssuePermission(User user, boolean issueCreation, Issue issue, String parameter)
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: "groupCF"

Public Constructors

public GroupCF (JiraAuthenticationContext jiraAuthenticationContext, GroupSelectorUtils groupSelectorUtils, CustomFieldManager customFieldManager, GroupManager groupManager)

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
customFieldId eg. 'customfield_10000'

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 BooleanQuery getQueryForProject (Project project, User searcher, String fieldName)

Gets called to produce the Lucene query for a project

Parameters
project The project for which to construct a query
searcher The user who is searching to add to the query
Returns
  • A BooleanQuery with the project and searcher terms, or null if the searcher is either null or not a known user

protected BooleanQuery getQueryForSecurityLevel (IssueSecurityLevel issueSecurity, User 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.

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 null if user is either null or not a known user

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

Determines if the given user has permission to see the given issue by using the custom field with the given custom field name to look up a group. Returns true only if the user is in the group.

Parameters
user the user for whom permission is being determined.
issueCreation not used.
issueGv the issue to which permission is being determined
customFieldName the name of the custom field.
Returns
  • true only if the user is in the group defined by the issue's named custom field.

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

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

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