com.atlassian.jira.security.type
Class ProjectLead

java.lang.Object
  extended by com.atlassian.jira.security.type.AbstractSecurityType
      extended by com.atlassian.jira.security.type.AbstractProjectsSecurityType
          extended by com.atlassian.jira.security.type.ProjectLead
All Implemented Interfaces:
SchemeType, SecurityType

public class ProjectLead
extends AbstractProjectsSecurityType


Field Summary
static String DESC
           
 
Constructor Summary
ProjectLead(JiraAuthenticationContext jiraAuthenticationContext)
           
 
Method Summary
 void doValidation(String key, Map parameters, JiraServiceContext jiraServiceContext)
           
 String getDisplayName()
           
 org.apache.lucene.search.Query getQuery(com.atlassian.crowd.embedded.api.User searcher, Project project, IssueSecurityLevel securityLevel, String parameter)
          Returns a query based on security level and the project passed in.
 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.
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String argument)
          Interface for determining if a permission type has the permission.
 boolean hasPermission(org.ofbiz.core.entity.GenericValue entity, String argument, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if the user is the project lead for the project.
 boolean hasPermission(Issue issue, String parameter)
          Determines if this permission type is satisfied for anonymous access.
 boolean hasPermission(Issue issue, String parameter, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if this permission type is satisfied.
 boolean hasPermission(Project project, String argument)
          Determines if this permission type is satisfied for anonymous access.
 boolean hasPermission(Project project, String argument, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
          Determines if this permission type is satisfied.
 
Methods inherited from class com.atlassian.jira.security.type.AbstractProjectsSecurityType
getQuery, getQuery
 
Methods inherited from class com.atlassian.jira.security.type.AbstractSecurityType
getArgumentDisplay, isValidForPermission
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESC

public static final String DESC
See Also:
Constant Field Values
Constructor Detail

ProjectLead

public ProjectLead(JiraAuthenticationContext jiraAuthenticationContext)
Method Detail

getDisplayName

public String getDisplayName()

getType

public String getType()

hasPermission

public boolean hasPermission(org.ofbiz.core.entity.GenericValue entity,
                             String argument)
Description copied from interface: SchemeType
Interface for determining if a permission type has the permission.

This method is called if there is no Remote User (ie anonymous)

Parameters:
entity - This is the issue or the project that the security is being checked for
argument - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
Returns:
true if anonymous Users have this permission.

hasPermission

public boolean hasPermission(Project project,
                             String argument)
Description copied from interface: SchemeType
Determines if this permission type is satisfied for anonymous access.

Parameters:
project - This is the project that the security is being checked for
argument - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
Returns:
true if anonymous Users have this permission.

hasPermission

public boolean hasPermission(Issue issue,
                             String parameter)
Description copied from interface: SchemeType
Determines if this permission type is satisfied for anonymous access.

Parameters:
issue - This is the issue that the security is being checked for
parameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
Returns:
true if anonymous Users have this permission.

hasPermission

public boolean hasPermission(org.ofbiz.core.entity.GenericValue entity,
                             String argument,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Determines if the user is the project lead for the project. The current project is derived from the entity using JiraUtils.getProject. If it is not then false is returned.

Parameters:
entity - The Generic Value. Should be an Issue or a Project
argument - Not needed for this implementation
user - User to check the permission on. If it is null then the check is made on the current user
issueCreation -
Returns:
true if the user is the project lead otherwise false
See Also:
AbstractIssueFieldSecurityType.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), AbstractIssueFieldSecurityType.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), SingleUser.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), GroupDropdown.hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String)

hasPermission

public boolean hasPermission(Project project,
                             String argument,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Description copied from interface: SchemeType
Determines if this permission type is satisfied.

Parameters:
project - This is the project that the security is being checked for
argument - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
user - The user for whom the permission is being checked
issueCreation - Whether this permission is being checked during issue creation
Returns:
true if the given User has this permission.

hasPermission

public boolean hasPermission(Issue issue,
                             String parameter,
                             com.atlassian.crowd.embedded.api.User user,
                             boolean issueCreation)
Description copied from interface: SchemeType
Determines if this permission type is satisfied.

Parameters:
issue - This is the issue that the security is being checked for
parameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)
user - The user for whom the permission is being checked
issueCreation - Whether this permission is being checked during issue creation
Returns:
true if the given User has this permission.

doValidation

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

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.

getQuery

public org.apache.lucene.search.Query getQuery(com.atlassian.crowd.embedded.api.User searcher,
                                               Project project,
                                               IssueSecurityLevel securityLevel,
                                               String parameter)
Description copied from interface: SecurityType
Returns a query based on security level and the project passed in. This may be required in particular for role based issue security levels. (see JRA-12739)

Specified by:
getQuery in interface SecurityType
Overrides:
getQuery in class AbstractProjectsSecurityType
Parameters:
searcher - The searcher conducting the search
project - The project for which we're constructing a query
securityLevel - The security level for which we are constructing the query
parameter - Parameter identifying user related field (reporter, assignee, etc)
Returns:
A lucene permissions query


Copyright © 2002-2014 Atlassian. All Rights Reserved.