|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.lenya.cms.ac.usecase.impl.UsecaseAuthorizerImpl
public class UsecaseAuthorizerImpl
Authorizer for usecases.
Supported parameters via Parameterizable
:
PARAMETER_CONFIGURATION
- location of the usecase policies file
(parameterizable for testing purposes)
Field Summary | |
---|---|
protected static java.lang.String |
PARAMETER_CONFIGURATION
|
protected static java.lang.String |
TYPE
|
protected static java.lang.String |
USECASE_PARAMETER
|
static java.lang.String |
VISIT_USECASE
The name of the pseudo-usecase that governs access to pages. |
Fields inherited from interface org.apache.lenya.ac.Authorizer |
---|
ROLE |
Constructor Summary | |
---|---|
UsecaseAuthorizerImpl()
|
Method Summary | |
---|---|
boolean |
authorize(org.apache.cocoon.environment.Request request)
This method will substitute VISIT_USECASE if no USECASE_PARAMETER is set, so that it can be used to authorize plain page access as well. |
boolean |
authorizeUsecase(java.lang.String usecase,
org.apache.lenya.ac.Role[] roles,
org.apache.lenya.cms.publication.Publication publication)
Authorizes a usecase by considering all roles of the current identity |
void |
dispose()
|
protected java.lang.String |
getConfigurationURI(org.apache.lenya.cms.publication.Publication publication)
Returns the source URI of the usecase role configuration file for a certain publication. |
protected UsecaseRoles |
getUsecaseRoles(java.lang.String _configurationUri)
|
boolean |
isPermitted(java.lang.String usecase,
org.apache.lenya.cms.publication.Publication publication,
org.apache.lenya.ac.Role role)
Checks whether the specified role is permitted to invoke a given usecase |
void |
parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
|
void |
service(org.apache.avalon.framework.service.ServiceManager _manager)
|
void |
setPermission(java.lang.String usecase,
org.apache.lenya.cms.publication.Publication publication,
org.apache.lenya.ac.Role role,
boolean granted)
Grants or denies a usecase to a role |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VISIT_USECASE
protected static final java.lang.String PARAMETER_CONFIGURATION
protected static final java.lang.String TYPE
protected static final java.lang.String USECASE_PARAMETER
Constructor Detail |
---|
public UsecaseAuthorizerImpl()
Method Detail |
---|
public boolean authorizeUsecase(java.lang.String usecase, org.apache.lenya.ac.Role[] roles, org.apache.lenya.cms.publication.Publication publication) throws org.apache.lenya.ac.AccessControlException
UsecaseAuthorizer
authorizeUsecase
in interface UsecaseAuthorizer
usecase
- The usecase ID.roles
- The roles of the current identity.publication
- The publication.
org.apache.lenya.ac.AccessControlException
- when something went wrong.UsecaseAuthorizer.authorizeUsecase(java.lang.String,
org.apache.lenya.ac.Role[],
org.apache.lenya.cms.publication.Publication)
public boolean isPermitted(java.lang.String usecase, org.apache.lenya.cms.publication.Publication publication, org.apache.lenya.ac.Role role) throws org.apache.lenya.ac.AccessControlException
UsecaseAuthorizer
isPermitted
in interface UsecaseAuthorizer
usecase
- The usecase.publication
- The publication.role
- The role.
org.apache.lenya.ac.AccessControlException
- if an error occurs.UsecaseAuthorizer.isPermitted(java.lang.String,
org.apache.lenya.cms.publication.Publication,
org.apache.lenya.ac.Role)
public void setPermission(java.lang.String usecase, org.apache.lenya.cms.publication.Publication publication, org.apache.lenya.ac.Role role, boolean granted) throws org.apache.lenya.ac.AccessControlException
UsecaseAuthorizer
setPermission
in interface UsecaseAuthorizer
usecase
- The usecase.publication
- The publication.role
- The role.granted
- If the usecase shall be permitted.
org.apache.lenya.ac.AccessControlException
- if an error occurs.UsecaseAuthorizer.setPermission(java.lang.String,
org.apache.lenya.cms.publication.Publication,
org.apache.lenya.ac.Role, boolean)
public boolean authorize(org.apache.cocoon.environment.Request request) throws org.apache.lenya.ac.AccessControlException
authorize
in interface org.apache.lenya.ac.Authorizer
org.apache.lenya.ac.AccessControlException
Authorizer.authorize(org.apache.cocoon.environment.Request)
protected java.lang.String getConfigurationURI(org.apache.lenya.cms.publication.Publication publication)
publication
- The publication.
protected UsecaseRoles getUsecaseRoles(java.lang.String _configurationUri) throws org.apache.lenya.ac.AccessControlException
org.apache.lenya.ac.AccessControlException
public void service(org.apache.avalon.framework.service.ServiceManager _manager) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
Disposable.dispose()
public void parameterize(org.apache.avalon.framework.parameters.Parameters parameters) throws org.apache.avalon.framework.parameters.ParameterException
parameterize
in interface org.apache.avalon.framework.parameters.Parameterizable
org.apache.avalon.framework.parameters.ParameterException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |