com.atlassian.jira.plugin.jql.function
Class ProjectsWhereUserHasPermissionFunction

java.lang.Object
  extended by com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
      extended by com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
          extended by com.atlassian.jira.plugin.jql.function.ProjectsWhereUserHasPermissionFunction
All Implemented Interfaces:
JqlFunction

public class ProjectsWhereUserHasPermissionFunction
extends AbstractUserCapabilityFunction

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.

Since:
v4.2

Field Summary
static java.lang.String FUNCTION_PROJECTS_WHERE_USER_HAS_PERMISSION
           
 
Fields inherited from class com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
userUtil
 
Constructor Summary
ProjectsWhereUserHasPermissionFunction(PermissionManager permissionManager, SchemePermissions schemePermissions, UserUtil userUtil)
           
 
Method Summary
 JiraDataType getDataType()
          Provides the JiraDataType that this function handles and creates values for.
protected  java.util.List<QueryLiteral> getFunctionValuesList(QueryCreationContext queryCreationContext, FunctionOperand functionOperand, com.opensymphony.user.User user, java.lang.String permissionName)
          Get the function return values based on the actual user and capability.
protected  java.lang.String getUserNotFoundMessageKey()
          Get the I18n message key for the error when the passed in user does not exist.
protected  MessageSet validateCapability(java.lang.String permissionName, I18nHelper i18n)
          Check the capability requested.
 
Methods inherited from class com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
getMinimumNumberOfExpectedArguments, getValues, validate
 
Methods inherited from class com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
getFunctionName, getI18n, getModuleDescriptor, init, isList, validateNumberOfArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FUNCTION_PROJECTS_WHERE_USER_HAS_PERMISSION

public static final java.lang.String FUNCTION_PROJECTS_WHERE_USER_HAS_PERMISSION
See Also:
Constant Field Values
Constructor Detail

ProjectsWhereUserHasPermissionFunction

public ProjectsWhereUserHasPermissionFunction(PermissionManager permissionManager,
                                              SchemePermissions schemePermissions,
                                              UserUtil userUtil)
Method Detail

getDataType

public JiraDataType getDataType()
Description copied from interface: JqlFunction
Provides the JiraDataType that this function handles and creates values for. This allows us to infer some information about how it will interact with other elements in the system.

For example, if this returns JiraDataTypes.DATE then we know that we can provide values for any clauses that also specify a data type of DATE.

Returns:
the JiraDataType that this function produces values for. Cannot be null.
See Also:
JiraDataTypes

validateCapability

protected MessageSet validateCapability(java.lang.String permissionName,
                                        I18nHelper i18n)
Description copied from class: AbstractUserCapabilityFunction
Check the capability requested.

Specified by:
validateCapability in class AbstractUserCapabilityFunction
Parameters:
permissionName - 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.

getFunctionValuesList

protected java.util.List<QueryLiteral> getFunctionValuesList(QueryCreationContext queryCreationContext,
                                                             FunctionOperand functionOperand,
                                                             com.opensymphony.user.User user,
                                                             java.lang.String permissionName)
Description copied from class: AbstractUserCapabilityFunction
Get the function return values based on the actual user and capability. transformed into index values.

Specified by:
getFunctionValuesList in class AbstractUserCapabilityFunction
Parameters:
queryCreationContext - the context of query creation
functionOperand - the operand to get values from
user - the user
permissionName - the capability being requested
Returns:
a List of objects that represent this Operands raw values. Cannot be null.

getUserNotFoundMessageKey

protected java.lang.String getUserNotFoundMessageKey()
Description copied from class: AbstractUserCapabilityFunction
Get the I18n message key for the error when the passed in user does not exist.

Specified by:
getUserNotFoundMessageKey in class AbstractUserCapabilityFunction
Returns:
message key.


Copyright © 2002-2010 Atlassian. All Rights Reserved.