Class CustomFieldClausePermissionChecker
java.lang.Object
com.atlassian.jira.jql.permission.CustomFieldClausePermissionChecker
- All Implemented Interfaces:
ClausePermissionChecker
@NonInjectableComponent
public class CustomFieldClausePermissionChecker
extends Object
implements ClausePermissionChecker
A clause permission checker for custom fields that will check the users permission to see the field and also that
the user has permission to see at least one context on the custom field.
- Since:
- v4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis is a factory so that we don't have a circular dependency on the Field manager.static interface -
Constructor Summary
ConstructorsConstructorDescriptionCustomFieldClausePermissionChecker(CustomField field, FieldManager fieldManager, FieldConfigSchemeClauseContextUtil clauseContextUtil) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks to see that the provided user is able to use the clause.booleanhasPermissionToUseClause(ApplicationUser user, Set<FieldLayout> fieldLayouts) Checks to see that the provided user is able to use the clause.
-
Constructor Details
-
CustomFieldClausePermissionChecker
public CustomFieldClausePermissionChecker(CustomField field, FieldManager fieldManager, FieldConfigSchemeClauseContextUtil clauseContextUtil)
-
-
Method Details
-
hasPermissionToUseClause
Description copied from interface:ClausePermissionCheckerChecks to see that the provided user is able to use the clause. This may be as simple as determining if the user has permission to see the field that the clause represents.- Specified by:
hasPermissionToUseClausein interfaceClausePermissionChecker- Parameters:
user- to check permissions against.- Returns:
- true if the user can use this clause, false otherwise.
-
hasPermissionToUseClause
Description copied from interface:ClausePermissionCheckerChecks to see that the provided user is able to use the clause. This method provides all the FieldLayouts visible to the given user as a shortcut otherwise individual checkers can end up looking this up dozens or even hundreds of times with causes slow downs in our search (see JRADEV-15665).- Specified by:
hasPermissionToUseClausein interfaceClausePermissionChecker- Parameters:
user- to check permissions against.fieldLayouts- The field Layouts available to the given user (value of.invalid reference
com.atlassian.jira.issue.fields.FieldManager#getVisibleFieldLayouts(User)- Returns:
- true if the user can use this clause, false otherwise.
-