public abstract class

AbstractIssueFieldSecurityType

extends AbstractSecurityType
java.lang.Object
   ↳ com.atlassian.jira.security.type.AbstractSecurityType
     ↳ com.atlassian.jira.security.type.AbstractIssueFieldSecurityType
Known Direct Subclasses
Known Indirect Subclasses

Summary

Public Constructors
AbstractIssueFieldSecurityType()
Public Methods
Query getQuery(User searcher, Project project, IssueSecurityLevel securityLevel, String parameter)
Query getQuery(User searcher, Project project, String parameter)
boolean hasPermission(Issue issue, String parameter, User user, boolean issueCreation)
boolean hasPermission(GenericValue entity, String argument)
boolean hasPermission(Issue issue, String argument)
boolean hasPermission(Project project, String argument)
boolean hasPermission(GenericValue entity, String argument, User user, boolean issueCreation)
Decides if the given User has permission to see the given issue or project.
boolean hasPermission(Project project, String parameter, User user, boolean issueCreation)
Protected Methods
abstract String getFieldName(String parameter)
Get the field name for this Issue Field-based Security Type given the parameter in the saved configuration.
@Nullable BooleanQuery getQueryForProject(Project project, User searcher, String fieldName)
Gets called to produce the Lucene query for a project
@Nullable BooleanQuery getQueryForSecurityLevel(IssueSecurityLevel issueSecurity, 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.
abstract boolean hasIssuePermission(User user, boolean issueCreation, GenericValue issueGv, String argument)
abstract boolean hasIssuePermission(User user, boolean issueCreation, Issue issue, String parameter)
abstract boolean hasProjectPermission(User user, boolean issueCreation, GenericValue project)
abstract boolean hasProjectPermission(User user, boolean issueCreation, Project project)
[Expand]
Inherited Methods
From class com.atlassian.jira.security.type.AbstractSecurityType
From class java.lang.Object
From interface com.atlassian.jira.scheme.SchemeType
From interface com.atlassian.jira.security.type.SecurityType

Public Constructors

public AbstractIssueFieldSecurityType ()

Public Methods

public Query getQuery (User searcher, Project project, IssueSecurityLevel securityLevel, String parameter)

public Query getQuery (User searcher, Project project, String parameter)

public boolean hasPermission (Issue issue, String parameter, User user, boolean issueCreation)

public boolean hasPermission (GenericValue entity, String argument)

public boolean hasPermission (Issue issue, String argument)

public boolean hasPermission (Project project, String argument)

public boolean hasPermission (GenericValue entity, String argument, User user, boolean issueCreation)

Decides if the given User has permission to see the given issue or project. 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 project only on the issues with the project It the entity is an Issue check if the user is in the relevent field in the issue

Parameters
entity The Generic Value. Should be an Issue (but sometimes it's 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 NFI
Returns
  • true if the user is the current assignee otherwise false

public boolean hasPermission (Project project, String parameter, User user, boolean issueCreation)

Protected Methods

protected abstract String getFieldName (String parameter)

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.

Parameters
parameter the parameter as saved in the config
Returns
  • the field name for this Issue Field-based Security Type.

@Nullable protected BooleanQuery getQueryForProject (Project project, User searcher, String fieldName)

Gets called to produce the Lucene query for a project

Parameters
project The project for which to construct a query
searcher The user who is searching to add to the query
Returns
  • A BooleanQuery with the project and searcher terms, or null if the searcher is either null or not a known user

@Nullable protected BooleanQuery getQueryForSecurityLevel (IssueSecurityLevel issueSecurity, 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.

Parameters
issueSecurity the security defined by this IssueFieldSecurityType instance.
searcher the user.
Returns
  • a query to constrain to the given issue security for the given user or null if user is either null or not a known user

protected abstract boolean hasIssuePermission (User user, boolean issueCreation, GenericValue issueGv, String argument)

protected abstract boolean hasIssuePermission (User user, boolean issueCreation, Issue issue, String parameter)

protected abstract boolean hasProjectPermission (User user, boolean issueCreation, GenericValue project)

protected abstract boolean hasProjectPermission (User user, boolean issueCreation, Project project)