public interface Authorizer
AuthenticationManager
consults the configured
Authorizer to determine which additional
Role
principals should be added to
the user's WikiSession. To determine which roles should be injected, the
Authorizer is queried for the roles it knows about by calling
getRoles()
. Then, each role
returned by the Authorizer is tested by calling
isUserInRole(WikiSession, Principal)
.
If this check fails, and the Authorizer is of type WebAuthorizer,
AuthenticationManager checks the role again by calling
WebAuthorizer.isUserInRole(javax.servlet.http.HttpServletRequest, Principal)
).
Any roles that pass the test are injected into the Subject by firing
appropriate authentication events.Modifier and Type | Method and Description |
---|---|
Principal |
findRole(String role)
Looks up and returns a role Principal matching a given String.
|
Principal[] |
getRoles()
Returns an array of role Principals this Authorizer knows about.
|
void |
initialize(WikiEngine engine,
Properties props)
Initializes the authorizer.
|
boolean |
isUserInRole(WikiSession session,
Principal role)
Determines whether the Subject associated with a WikiSession is in a
particular role.
|
Principal[] getRoles()
Principal findRole(String role)
null
.
Note that it may not always be feasible for an Authorizer implementation
to return a role Principal.role
- the name of the role to retrievevoid initialize(WikiEngine engine, Properties props) throws WikiSecurityException
engine
- the current wiki engineprops
- the wiki engine initialization propertiesWikiSecurityException
- if the Authorizer could not be initializedboolean isUserInRole(WikiSession session, Principal role)
null
, this method must
return false
.session
- the current WikiSessionrole
- the role to checktrue
if the user is considered to be in the role,
false
otherwiseCopyright © 2001-2019 The Apache Software Foundation. All rights reserved.