com.atlassian.jira.security.type
Class UserCF
java.lang.Object
com.atlassian.jira.security.type.AbstractSecurityType
com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
com.atlassian.jira.security.type.UserCF
- All Implemented Interfaces:
- SchemeType, SecurityType
public class UserCF
- extends AbstractIssueFieldSecurityType
Issue Security and Permission type for a User Selector custom field,
or select-list custom fields which specify users.
Method Summary |
void |
doValidation(String key,
Map parameters,
JiraServiceContext jiraServiceContext)
|
String |
getArgumentDisplay(String argument)
|
List |
getDisplayFields()
|
String |
getDisplayName()
|
protected String |
getFieldName()
|
org.apache.lucene.search.Query |
getQuery(com.atlassian.crowd.embedded.api.User searcher,
org.ofbiz.core.entity.GenericValue entity,
String parameter)
|
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)
Defines whether the given user has permission to see the given issue using
the issue's value of the named custom field. |
protected boolean |
hasProjectPermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
org.ofbiz.core.entity.GenericValue project)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
UserCF
public UserCF(JiraAuthenticationContext jiraAuthenticationContext,
CustomFieldManager customFieldManager)
getDisplayName
public String getDisplayName()
getType
public String getType()
getQuery
public org.apache.lucene.search.Query getQuery(com.atlassian.crowd.embedded.api.User searcher,
org.ofbiz.core.entity.GenericValue entity,
String parameter)
- Specified by:
getQuery
in interface SecurityType
- Overrides:
getQuery
in class AbstractIssueFieldSecurityType
doValidation
public void doValidation(String key,
Map parameters,
JiraServiceContext jiraServiceContext)
getFieldName
protected String getFieldName()
- Specified by:
getFieldName
in class AbstractIssueFieldSecurityType
hasProjectPermission
protected boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
org.ofbiz.core.entity.GenericValue project)
- Specified by:
hasProjectPermission
in class AbstractIssueFieldSecurityType
hasIssuePermission
protected boolean hasIssuePermission(com.atlassian.crowd.embedded.api.User user,
boolean issueCreation,
org.ofbiz.core.entity.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.
- Specified by:
hasIssuePermission
in class AbstractIssueFieldSecurityType
- 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.
getDisplayFields
public List getDisplayFields()
getArgumentDisplay
public String getArgumentDisplay(String argument)
- Specified by:
getArgumentDisplay
in interface SecurityType
- Overrides:
getArgumentDisplay
in class AbstractSecurityType
getUsers
public Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx,
String customFieldId)
- Get user specified by the Custom Field
- Specified by:
getUsers
in interface SecurityType
- Overrides:
getUsers
in class AbstractIssueFieldSecurityType
- Parameters:
ctx
- permission contextcustomFieldId
- 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).
Copyright © 2002-2012 Atlassian. All Rights Reserved.