com.atlassian.jira.security.type
Class AbstractIssueFieldSecurityType

java.lang.Object
  extended bycom.atlassian.jira.security.type.AbstractSecurityType
      extended bycom.atlassian.jira.security.type.AbstractIssueFieldSecurityType
All Implemented Interfaces:
SchemeType, SecurityType
Direct Known Subclasses:
CurrentAssignee, CurrentAssigneeHasAssignablePermission, CurrentReporter, CurrentReporterHasCreatePermission, UserCF

public abstract class AbstractIssueFieldSecurityType
extends AbstractSecurityType


Constructor Summary
AbstractIssueFieldSecurityType()
           
 
Method Summary
protected abstract  String getField()
           
protected abstract  String getFieldName()
           
 org.apache.lucene.search.Query getQuery(User searcher, org.ofbiz.core.entity.GenericValue entity, String parameter)
           
protected  boolean hasIssuePermission(User user, boolean issueCreation, org.ofbiz.core.entity.GenericValue entity, String argument)
           
 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, User user, boolean issueCreation)
          This function takes a user a decides if they have a permission If the user is null they can never have the permission so false is returned.
protected abstract  boolean hasProjectPermission(User user, boolean issueCreation, org.ofbiz.core.entity.GenericValue project)
           
 
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
 
Methods inherited from interface com.atlassian.jira.scheme.SchemeType
doValidation, getDisplayName, getType
 

Constructor Detail

AbstractIssueFieldSecurityType

public AbstractIssueFieldSecurityType()
Method Detail

getFieldName

protected abstract String getFieldName()

getQuery

public org.apache.lucene.search.Query getQuery(User searcher,
                                               org.ofbiz.core.entity.GenericValue entity,
                                               String parameter)

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 {@link com.atlassian.jira.security.type.GroupDropdown)

hasPermission

public boolean hasPermission(org.ofbiz.core.entity.GenericValue entity,
                             String argument,
                             User user,
                             boolean issueCreation)
This function takes a user a decides if they have a permission If the user is null they can never have the permission so false is returned. If the entity is a Project the permission is always true as report and assignee have no context in a projec only on the issues with the projet It the entity is an Issue check if the user is in the relevent field in the issue

Parameters:
entity - The Generic Value. Shoule be an Issue
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 current assignee otherwise false
See Also:
hasPermission(org.ofbiz.core.entity.GenericValue, java.lang.String), ProjectLead.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)

hasIssuePermission

protected boolean hasIssuePermission(User user,
                                     boolean issueCreation,
                                     org.ofbiz.core.entity.GenericValue entity,
                                     String argument)

hasProjectPermission

protected abstract boolean hasProjectPermission(User user,
                                                boolean issueCreation,
                                                org.ofbiz.core.entity.GenericValue project)

getField

protected abstract String getField()


Copyright © 2002-2006 Atlassian. All Rights Reserved.