In the case of using the core forum services through a web interface, the expected behavior is to have a user login and then store the Authorization object in their session.
(Note by Matt) It's my opinion that this authorization method needs better security. At the moment, this method is certainly ok if forum skins can be trusted. However, the security goal has always been to protect as much as possible against malicious skins. Therefore, the implementation of this class will be changed in the near future to use signed objects. Some thought will have to be given to a public/private key management system, so I'm going to delay implementing it for now. This means -- be sure you can trust your skins!! @see AuthorizationFactory @see ForumFactory
User: Zhang Kaitao
Date: 14-3-13
Version: 1.0
An {@link Authorization} assigns a set of {@link Permission Permissions}to an identity to interact with a given {@link Resource}.
EXAMPLES:
camunda BPM distinguished two types of identities: users and groups. Authorizations can either range over all users (userId = {@link #ANY}), an individual {@link User} or a {@link Group} of users.
A {@link Permission} defines the way an identity is allowed to interactwith a certain resource. Examples of permissions are {@link Permissions#CREATE CREATE}, {@link Permissions#READ READ}, {@link Permissions#UPDATE UPDATE}, {@link Permissions#DELETE DELETE}, ... See {@link Permissions} for a set ofbuilt-in permissions.
A single authorization object may assign multiple permissions to a single user and resource:
authorization.addPermission(Permissions.READ); authorization.addPermission(Permissions.WRITE); authorization.addPermission(Permissions.DELETE);
On top of the built-in permissions, camunda BPM allows using custom permission types.
Resources are the entities the user interacts with. Examples of resources are {@link Resources#GROUP GROUPS}, {@link Resources#USER USERS}, process-definitions, process-instances, tasks ... See {@link Resources} for a setof built-in resource. The camunda BPM framework supports custom resources.
There are three types of authorizations:
Authorizations may range over all users, an individual user or a group of users or . They may apply to an individual resource instance or all instances of the same type (resourceId = {@link #ANY}). The precedence is as follows:
In the case of using the core forum services through a web interface, the expected behavior is to have a user login and then store the Authorization object in their session.
(Note by Matt) It's my opinion that this authorization method needs better security. At the moment, this method is certainly ok if forum skins can be trusted. However, the security goal has always been to protect as much as possible against malicious skins. Therefore, the implementation of this class will be changed in the near future to use signed objects. Some thought will have to be given to a public/private key management system, so I'm going to delay implementing it for now. This means -- be sure you can trust your skins!! @see AuthorizationFactory @see ForumFactory
Bundles associate the privilege to access restricted resources or operations with roles. Before granting access to a restricted resource or operation, a bundle will check if the {@code Authorization} object passed to it possessthe required role, by calling its {@code hasRole} method.
Authorization contexts are instantiated by calling the {@link UserAdmin#getAuthorization(User)} method.
Trusting Authorization objects
There are no restrictions regarding the creation of {@code Authorization}objects. Hence, a service must only accept {@code Authorization} objects frombundles that has been authorized to use the service using code based (or Java 2) permissions.
In some cases it is useful to use {@code ServicePermission} to do the codebased access control. A service basing user access control on {@code Authorization} objects passed to it, will then require that a callingbundle has the {@code ServicePermission} to get the service in question. Thisis the most convenient way. The OSGi environment will do the code based permission check when the calling bundle attempts to get the service from the service registry.
Example: A servlet using a service on a user's behalf. The bundle with the servlet must be given the {@code ServicePermission} to get the Http Service.
However, in some cases the code based permission checks need to be more fine-grained. A service might allow all bundles to get it, but require certain code based permissions for some of its methods.
Example: A servlet using a service on a user's behalf, where some service functionality is open to anyone, and some is restricted by code based permissions. When a restricted method is called (e.g., one handing over an {@code Authorization} object), the service explicitly checks that the callingbundle has permission to make the call. @noimplement @author $Id: 4786641d1725f18fb3bc160059d7f8b28e46bbab $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|