Class ProjectsWhereUserHasPermissionFunction
java.lang.Object
com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
com.atlassian.jira.plugin.jql.function.ProjectsWhereUserHasPermissionFunction
- All Implemented Interfaces:
JqlFunction
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
FieldsFields inherited from class com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
userUtil -
Constructor Summary
ConstructorsConstructorDescriptionProjectsWhereUserHasPermissionFunction(PermissionManager permissionManager, UserUtil userUtil, I18nHelper.BeanFactory i18nHelperFactory) -
Method Summary
Modifier and TypeMethodDescriptionProvides theJiraDataTypethat this function handles and creates values for.protected List<QueryLiteral> getFunctionValuesList(QueryCreationContext queryCreationContext, FunctionOperand functionOperand, ApplicationUser user, String permissionName) Get the function return values based on the actual user and capability.protected StringGet the I18n message key for the error when the passed in user does not exist.protected MessageSetvalidateCapability(String permissionName, I18nHelper i18n) Check the capability requested.Methods inherited from class com.atlassian.jira.plugin.jql.function.AbstractUserCapabilityFunction
getMinimumNumberOfExpectedArguments, getValues, validateMethods inherited from class com.atlassian.jira.plugin.jql.function.AbstractJqlFunction
getFunctionName, getI18n, getModuleDescriptor, init, isList, validateNumberOfArgs
-
Field Details
-
FUNCTION_PROJECTS_WHERE_USER_HAS_PERMISSION
- See Also:
-
-
Constructor Details
-
ProjectsWhereUserHasPermissionFunction
public ProjectsWhereUserHasPermissionFunction(PermissionManager permissionManager, UserUtil userUtil, I18nHelper.BeanFactory i18nHelperFactory)
-
-
Method Details
-
getDataType
Description copied from interface:JqlFunctionProvides theJiraDataTypethat 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.DATEthen 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:
-
validateCapability
Description copied from class:AbstractUserCapabilityFunctionCheck the capability requested.- Specified by:
validateCapabilityin classAbstractUserCapabilityFunction- Parameters:
permissionName- The name of the capability being checked. This will be the name of something like a permission or rolei18n- I18Helper- Returns:
- a
MessageSetwhich must not be null, but may be empty when there are no errors.
-
getFunctionValuesList
protected List<QueryLiteral> getFunctionValuesList(QueryCreationContext queryCreationContext, FunctionOperand functionOperand, ApplicationUser user, String permissionName) Description copied from class:AbstractUserCapabilityFunctionGet the function return values based on the actual user and capability. transformed into index values.- Specified by:
getFunctionValuesListin classAbstractUserCapabilityFunction- Parameters:
queryCreationContext- the context of query creationfunctionOperand- the operand to get values fromuser- 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-21476permissionName- the capability being requested- Returns:
- a List of objects that represent this Operands raw values. Cannot be null.
-
getUserNotFoundMessageKey
Description copied from class:AbstractUserCapabilityFunctionGet the I18n message key for the error when the passed in user does not exist.- Specified by:
getUserNotFoundMessageKeyin classAbstractUserCapabilityFunction- Returns:
- message key.
-