com.atlassian.jira.security.type
Class CurrentReporterHasCreatePermission

java.lang.Object
  extended by com.atlassian.jira.security.type.AbstractSecurityType
      extended by com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
          extended by com.atlassian.jira.security.type.SimpleIssueFieldSecurityType
              extended by com.atlassian.jira.security.type.CurrentReporterHasCreatePermission
All Implemented Interfaces:
SchemeType, SecurityType

public class CurrentReporterHasCreatePermission
extends SimpleIssueFieldSecurityType


Constructor Summary
CurrentReporterHasCreatePermission(JiraAuthenticationContext jiraAuthenticationContext)
           
 
Method Summary
 void doValidation(String key, Map parameters, JiraServiceContext jiraServiceContext)
           
 String getDisplayName()
           
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.
 String getType()
           
 Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx, String ignored)
          Returns a list of Users represented by a security type instance.
protected  boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user, boolean issueCreation, org.ofbiz.core.entity.GenericValue gvProject)
           
protected  boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user, boolean issueCreation, Project project)
           
 boolean isValidForPermission(int permissionId)
          Is valid for all permissions except "Create Issue".
 
Methods inherited from class com.atlassian.jira.security.type.SimpleIssueFieldSecurityType
hasIssuePermission, hasIssuePermission
 
Methods inherited from class com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
getQuery, getQuery, getQueryForProject, getQueryForSecurityLevel, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission
 
Methods inherited from class com.atlassian.jira.security.type.AbstractSecurityType
getArgumentDisplay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentReporterHasCreatePermission

public CurrentReporterHasCreatePermission(JiraAuthenticationContext jiraAuthenticationContext)
Method Detail

getDisplayName

public String getDisplayName()

getType

public String getType()

doValidation

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

isValidForPermission

public boolean isValidForPermission(int permissionId)
Is valid for all permissions except "Create Issue".

Because we rely on the permissions for the "Create Issue" function, then not only does it not make sense to add this role to "Create Issue", it would actually cause an infinite loop. see JRA-13315

Specified by:
isValidForPermission in interface SchemeType
Overrides:
isValidForPermission in class AbstractSecurityType
Parameters:
permissionId - permission id.
Returns:
false for Permissions.CREATE_ISSUE, true otherwise.
See Also:
CurrentReporterHasCreatePermission

getFieldName

protected String getFieldName(String parameter)
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 class AbstractIssueFieldSecurityType
Parameters:
parameter - the parameter as saved in the config
Returns:
the field name for this Issue Field-based Security Type.

hasProjectPermission

protected boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user,
                                       boolean issueCreation,
                                       org.ofbiz.core.entity.GenericValue gvProject)
Specified by:
hasProjectPermission in class AbstractIssueFieldSecurityType

hasProjectPermission

protected boolean hasProjectPermission(com.atlassian.crowd.embedded.api.User user,
                                       boolean issueCreation,
                                       Project project)
Specified by:
hasProjectPermission in class AbstractIssueFieldSecurityType

getField

protected String getField()
Specified by:
getField in class SimpleIssueFieldSecurityType

getUsers

public Set<com.atlassian.crowd.embedded.api.User> getUsers(PermissionContext ctx,
                                                           String ignored)
Description copied from interface: SecurityType
Returns a list of Users represented by a security type instance. The collection must not contain any nulls.

Parameters:
ctx - The current issue and project
ignored - Instance value, eg. a group name, user name, custom field id
Returns:
A set of Users.

getFieldValue

protected String getFieldValue(Issue issue)
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 class SimpleIssueFieldSecurityType
Parameters:
issue - the Issue
Returns:
the user key value for the given issue for the field that this security type checks.


Copyright © 2002-2013 Atlassian. All Rights Reserved.