com.atlassian.jira.security.auth
Enum Authorisation.Decision

java.lang.Object
  extended by java.lang.Enum<Authorisation.Decision>
      extended by com.atlassian.jira.security.auth.Authorisation.Decision
All Implemented Interfaces:
Serializable, Comparable<Authorisation.Decision>
Enclosing interface:
Authorisation

public static enum Authorisation.Decision
extends Enum<Authorisation.Decision>

When deciding whether to authorise a request, you can either grant it, deny or abstain from a decision


Enum Constant Summary
ABSTAIN
           
DENIED
           
GRANTED
           
 
Method Summary
 boolean toBoolean()
          Helper to turn GRANTED into true and anything else into false

This is turning tri-state logic into binary logic.

static Authorisation.Decision toDecision(boolean answer)
          Helper to turn boolean answers into GRANTED or DENIED

static Authorisation.Decision valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Authorisation.Decision[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GRANTED

public static final Authorisation.Decision GRANTED

DENIED

public static final Authorisation.Decision DENIED

ABSTAIN

public static final Authorisation.Decision ABSTAIN
Method Detail

values

public static Authorisation.Decision[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Authorisation.Decision c : Authorisation.Decision.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Authorisation.Decision valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toBoolean

public boolean toBoolean()
Helper to turn GRANTED into true and anything else into false

This is turning tri-state logic into binary logic. Use deliberately.

Returns:
true if GRANTED otherwise false

toDecision

public static Authorisation.Decision toDecision(boolean answer)
Helper to turn boolean answers into GRANTED or DENIED

Parameters:
answer - the boolean answer
Returns:
GRANTED if true otherwise DENIED


Copyright © 2002-2013 Atlassian. All Rights Reserved.