|
|||||||||
Home >> All >> com >> RuntimeCollective >> permission >> [ bean overview ] | PREV PACKAGE NEXT PACKAGE |
Package com.RuntimeCollective.permission.bean
The Permission module provides support for much more flexible Permission logic than webapps.bean.PermissionBean.
See:
Description
Interface Summary | |
Permissible | Interface to implement if you want the access to your object to be constrained by PermissionRules. |
PermissionRule | Interface that defines a permission ruls, which determines whether a user has access to some part of the system. |
Class Summary | |
PermissibleExtension | An extension which can be used to stick the Permissible behaviour to any bean. |
SimplePermissible | A simple implementation of Permissible. |
SimplePermissionRule | A very simple implementation of PermissionRule. |
UserGroupPermissionRule | A permission rule whose behaviour depends on whether the user is a member of a group |
Package com.RuntimeCollective.permission.bean Description
The Permission module provides support for much more flexible Permission logic than webapps.bean.PermissionBean. It is easy to define new PermissionRule logic classes, and to constrain any Object by such a PermissionRule class.
1. Creating a new permission.bean.PermissionRule
The PermissionRule interface is very simple: it has a Key (an internal identifier by which you can recognise ready-made instances), and two methods which will have to be re-defined by each implementation:- void accepts(User user) - whether a User can pass this PermissionRule's test.
- String getAuthorisationPath(User user, Session session, ReturnPathContainer rpContainer, String returnPath) - to know where a User (via its webapps Session) should be sent in order to try to get authorised by this PermissionRule. Once the User has been sent to the returned path, he may be checked again by the accepts(User user) method. The returned path is usually a Logon page, but could be something else such as a Questionnaire page, etc.
2. Creating a new permission.bean.Permissible
Objects which implement the Permissible interface can be assigned a PermissionRule for any given "action". You can for example set up different PermissionRules for "view" and for "edit". Permissible is an extension of webapps.bean.PermissionBean, and is implemented by a basic permission.bean.SimplePermissible. The permission.tag.CheckPermissionTag tag helps checking if a User can perform an "action" on a Permissible within a JSP page.
|
|||||||||
Home >> All >> com >> RuntimeCollective >> permission >> [ bean overview ] | PREV PACKAGE NEXT PACKAGE |