com.atlassian.jira.jql.permission
Class FieldClausePermissionChecker

java.lang.Object
  extended by com.atlassian.jira.jql.permission.FieldClausePermissionChecker
All Implemented Interfaces:
ClausePermissionChecker

@NonInjectableComponent
public class FieldClausePermissionChecker
extends Object
implements ClausePermissionChecker

A clause permission checker that will check only the users permission to see the field, based on the configured field configuration schemes.

Since:
v4.0

Nested Class Summary
static class FieldClausePermissionChecker.DefaultFactory
          This is a factory so that we don't have a circular dependency on the Field manager.
static interface FieldClausePermissionChecker.Factory
           
 
Constructor Summary
FieldClausePermissionChecker(Field field, FieldManager fieldManager)
           
 
Method Summary
 boolean hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User user)
          Checks to see that the provided user is able to use the clause.
 boolean hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User searcher, Set<FieldLayout> fieldLayouts)
          Checks to see that the provided user is able to use the clause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldClausePermissionChecker

public FieldClausePermissionChecker(Field field,
                                    FieldManager fieldManager)
Method Detail

hasPermissionToUseClause

public boolean hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User user)
Description copied from interface: ClausePermissionChecker
Checks 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:
hasPermissionToUseClause in interface ClausePermissionChecker
Parameters:
user - to check permissions against.
Returns:
true if the user can use this clause, false otherwise.

hasPermissionToUseClause

public boolean hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User searcher,
                                        Set<FieldLayout> fieldLayouts)
Description copied from interface: ClausePermissionChecker
Checks 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:
hasPermissionToUseClause in interface ClausePermissionChecker
Parameters:
searcher - to check permissions against.
fieldLayouts - The field Layouts available to the given user (value of FieldManager.getVisibleFieldLayouts(User).
Returns:
true if the user can use this clause, false otherwise.


Copyright © 2002-2014 Atlassian. All Rights Reserved.