public class GroupCF extends AbstractIssueFieldSecurityType
Constructor and Description |
---|
GroupCF(JiraAuthenticationContext jiraAuthenticationContext,
GroupSelectorUtils groupSelectorUtils,
CustomFieldManager customFieldManager,
GroupManager groupManager) |
Modifier and Type | Method and Description |
---|---|
void |
doValidation(String key,
Map<String,String> parameters,
JiraServiceContext jiraServiceContext) |
String |
getArgumentDisplay(String argument) |
List<Field> |
getDisplayFields() |
String |
getDisplayName() |
protected String |
getFieldName(String parameter)
Get the field name for this Issue Field-based Security Type given the parameter in the saved configuration.
|
protected org.apache.lucene.search.BooleanQuery |
getQueryForProject(Project project,
com.atlassian.crowd.embedded.api.User searcher,
String fieldName)
Gets called to produce the Lucene query for a project
|
protected org.apache.lucene.search.BooleanQuery |
getQueryForSecurityLevel(IssueSecurityLevel issueSecurity,
com.atlassian.crowd.embedded.api.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.
|
String |
getType() |
Set<com.atlassian.crowd.embedded.api.User> |
getUsers(PermissionContext ctx,
String customFieldId)
Get user specified by the Custom Field
|
protected boolean |
hasIssuePermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
org.ofbiz.core.entity.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.
|
protected boolean |
hasIssuePermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
Issue issue,
String parameter) |
protected boolean |
hasProjectPermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
org.ofbiz.core.entity.GenericValue project) |
protected boolean |
hasProjectPermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
Project project) |
getQuery, getQuery, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission
isValidForPermission
public static final String TYPE
public GroupCF(JiraAuthenticationContext jiraAuthenticationContext, GroupSelectorUtils groupSelectorUtils, CustomFieldManager customFieldManager, GroupManager groupManager)
public String getDisplayName()
public String getType()
protected org.apache.lucene.search.BooleanQuery getQueryForProject(Project project, com.atlassian.crowd.embedded.api.User searcher, String fieldName)
AbstractIssueFieldSecurityType
getQueryForProject
in class AbstractIssueFieldSecurityType
project
- The project for which to construct a querysearcher
- The user who is searching to add to the querynull
if the searcher is either
null
or not a known userprotected org.apache.lucene.search.BooleanQuery getQueryForSecurityLevel(IssueSecurityLevel issueSecurity, com.atlassian.crowd.embedded.api.User searcher, String fieldName)
AbstractIssueFieldSecurityType
getQueryForSecurityLevel
in class AbstractIssueFieldSecurityType
issueSecurity
- the security defined by this IssueFieldSecurityType instance.searcher
- the user.null
if user is either
null
or not a known userpublic void doValidation(String key, Map<String,String> parameters, JiraServiceContext jiraServiceContext)
protected String getFieldName(String parameter)
AbstractIssueFieldSecurityType
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.
getFieldName
in class AbstractIssueFieldSecurityType
parameter
- the parameter as saved in the configprotected boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user, boolean issueCreation, org.ofbiz.core.entity.GenericValue project)
hasProjectPermission
in class AbstractIssueFieldSecurityType
protected boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user, boolean issueCreation, Project project)
hasProjectPermission
in class AbstractIssueFieldSecurityType
protected boolean hasIssuePermission(com.atlassian.crowd.embedded.api.User user, boolean issueCreation, org.ofbiz.core.entity.GenericValue issueGv, String customFieldName)
hasIssuePermission
in class AbstractIssueFieldSecurityType
user
- the user for whom permission is being determined.issueCreation
- not used.issueGv
- the issue to which permission is being determinedcustomFieldName
- the name of the custom field.protected boolean hasIssuePermission(com.atlassian.crowd.embedded.api.User user, boolean issueCreation, Issue issue, String parameter)
hasIssuePermission
in class AbstractIssueFieldSecurityType
public String getArgumentDisplay(String argument)
getArgumentDisplay
in interface SecurityType
getArgumentDisplay
in class AbstractSecurityType
public Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx, String customFieldId)
customFieldId
- eg. 'customfield_10000'ctx
- The current issue and projectUser
s.Copyright © 2002-2015 Atlassian. All Rights Reserved.