public final class AuthorizationOutcome extends Object
The possible states are:
Modifier and Type | Method and Description |
---|---|
static AuthorizationOutcome |
createForbidden(String aMessage)
Creates a "forbidden" outcome with a message.
|
static AuthorizationOutcome |
createForbidden(UserMessage anUserMessage)
Creates a "forbidden" outcome with a localized message.
|
static AuthorizationOutcome |
getAuthorized()
Getter that returns an authorized autocome with no message.
|
static AuthorizationOutcome |
getForbidden()
Factory method that specifies that a user is forbidden
to access the REST resource.
|
UserMessage |
getMessage()
Returns a
UserMessage that must be added to the HTTP response
in case of forbidden state. |
boolean |
isAuthorized()
Defines if the REST resource is accessible according to
the evaluated
AuthorizationRule . |
boolean |
isForbidden()
Defines if the REST resource is not accessible according to
the evaluated
AuthorizationRule . |
public static AuthorizationOutcome getAuthorized()
public static AuthorizationOutcome getForbidden()
No specific message is returned to the client.
public static AuthorizationOutcome createForbidden(UserMessage anUserMessage)
anUserMessage
- specifies the localized message
that will be returned to the clientgetForbidden()
,
SessionContext.getLocale()
public static AuthorizationOutcome createForbidden(String aMessage)
aMessage
- specifies the message that will be returned to the clientgetForbidden()
public boolean isAuthorized()
AuthorizationRule
.true
if the REST resource is considered accessible,
false
otherwisepublic boolean isForbidden()
AuthorizationRule
.true
if the REST resource is considered not accessible,
false
otherwisepublic UserMessage getMessage()
UserMessage
that must be added to the HTTP response
in case of forbidden state.