com.atlassian.jira.jql.permission
Class ProjectClauseValueSanitiser

java.lang.Object
  extended by com.atlassian.jira.jql.permission.ProjectClauseValueSanitiser
All Implemented Interfaces:
ClauseSanitiser

public class ProjectClauseValueSanitiser
extends Object
implements ClauseSanitiser

Sanitises clauses which have Project keys, names or ids as their values.

Since:
v4.0

Constructor Summary
ProjectClauseValueSanitiser(PermissionManager permissionManager, JqlOperandResolver jqlOperandResolver, NameResolver<Project> projectResolver)
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 Clause sanitise(com.atlassian.crowd.embedded.api.User user, TerminalClause clause)
          Important note: we are making a big assumption here that the ProjectClauseValueSanitiser.ProjectOperandSanitisingVisitor will always return the same kind of operand back after sanitising.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectClauseValueSanitiser

public ProjectClauseValueSanitiser(PermissionManager permissionManager,
                                   JqlOperandResolver jqlOperandResolver,
                                   NameResolver<Project> projectResolver)
Method Detail

sanitise

public Clause sanitise(com.atlassian.crowd.embedded.api.User user,
                       TerminalClause clause)
Important note: we are making a big assumption here that the ProjectClauseValueSanitiser.ProjectOperandSanitisingVisitor will always return the same kind of operand back after sanitising. This is because project literals can never expand to more than one index value for a named literal. Therefore, the multiplicity of the operand does not change after sanitising. Because of this, we blindly reuse the original operator from the input clause. If this assumption ever changes, we will need to revisit this code.

Specified by:
sanitise in interface ClauseSanitiser
Parameters:
clause - the clause to sanitise
user - the user performing the search
Returns:
the sanitised clause; never null.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2002-2012 Atlassian. All Rights Reserved.