public class

ProjectsWhereUserHasRoleFunction

extends AbstractUserCapabilityFunction
java.lang.Object
   ↳ com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
     ↳ com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
       ↳ com.atlassian.jira.plugin.jql.function.ProjectsWhereUserHasRoleFunction

Class Overview

This function returns a list of projects where the user has the requested permission.

This function expects zero or one argument. If zero arguments are supplied the current logged in user will be used as component lead.

Summary

Constants
String FUNCTION_PROJECTS_WHERE_USER_HAS_PERMISSION
[Expand]
Inherited Fields
From class com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
Public Constructors
ProjectsWhereUserHasRoleFunction(PermissionManager permissionManager, ProjectRoleManager projectRoleManager, ProjectManager projectManager, UserUtil userUtil)
Public Methods
JiraDataType getDataType()
Protected Methods
List<QueryLiteral> getFunctionValuesList(QueryCreationContext queryCreationContext, FunctionOperand functionOperand, ApplicationUser user, String roleName)
Get the function return values based on the actual user and capability.
String getUserNotFoundMessageKey()
Get the I18n message key for the error when the passed in user does not exist.
MessageSet validateCapability(String roleName, I18nHelper i18n)
Check the capability requested.
[Expand]
Inherited Methods
From class com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
From class com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
From class java.lang.Object
From interface com.atlassian.jira.plugin.jql.function.JqlFunction

Constants

public static final String FUNCTION_PROJECTS_WHERE_USER_HAS_PERMISSION

Constant Value: "projectsWhereUserHasRole"

Public Constructors

public ProjectsWhereUserHasRoleFunction (PermissionManager permissionManager, ProjectRoleManager projectRoleManager, ProjectManager projectManager, UserUtil userUtil)

Public Methods

public JiraDataType getDataType ()

Protected Methods

protected List<QueryLiteral> getFunctionValuesList (QueryCreationContext queryCreationContext, FunctionOperand functionOperand, ApplicationUser user, String roleName)

Get the function return values based on the actual user and capability. transformed into index values.

Parameters
queryCreationContext the context of query creation
functionOperand the operand to get values from
user the user. This value may be the searcher or a user the searcher is enquiring on behalf of. If the 2nd parameter (a User) of the function is supplied then the capability of that user is quueried. The functionality to run this for a user other than the logged in user has been removed until decisions can be made regarding http://jira.atlassian.com/browse/JRA-21476
roleName the capability being requested
Returns
  • a List of objects that represent this Operands raw values. Cannot be null.

protected String getUserNotFoundMessageKey ()

Get the I18n message key for the error when the passed in user does not exist.

Returns
  • message key.

protected MessageSet validateCapability (String roleName, I18nHelper i18n)

Check the capability requested.

Parameters
roleName The name of the capability being checked. This will be the name of something like a permission or role
i18n I18Helper
Returns
  • a MessageSet which must not be null, but may be empty when there are no errors.