Index: openacs-4/packages/acs-core-docs/www/permissions-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-design.html,v diff -u -r1.25 -r1.26 --- openacs-4/packages/acs-core-docs/www/permissions-design.html 16 Feb 2005 00:21:03 -0000 1.25 +++ openacs-4/packages/acs-core-docs/www/permissions-design.html 4 Jun 2006 00:45:24 -0000 1.26 @@ -1,4 +1,5 @@ -Permissions Design

Permissions Design

By John Prevost and Rafael H. Schloming

+ +Permissions Design

Permissions Design

By John Prevost and Rafael H. Schloming

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

Essentials

There are also a number of views to make it easier to ask specific questions about permissions. For example, a number of the above tables -describe "direct" or explicit permissions. Inheritance and default +describe "direct" or explicit permissions. Inheritance and default values can, however, introduce permissions which are not directly specified. (For example, read access on a forum allows read access on all the messages in the forum.)

The following views provide flattened versions of inherited @@ -91,34 +92,34 @@ a member of

  • privileges get associated with the methods of any other privileges they have taken methods from (at any level) (see acs_privilege_hierarchy)

  • objects get access control from direct grants, or inherit permissions -from their context (unless the "don't inherit" flag is +from their context (unless the "don't inherit" flag is set)

  • Legal Transactions

    There are three essential areas in which all transactions in the -permissions system fall:

    • Modification of methods and privileges

    • Modification of permissions

    • Queries on permissions

    "Modification of methods and privileges." This +permissions system fall:

    • Modification of methods and privileges

    • Modification of permissions

    • Queries on permissions

    "Modification of methods and privileges." This refers to actions that happen mainly at package installation time - a package will create a number of methods for its own use, then associate them with the system's standard privileges, or new privileges which the package has created. The association step might also happen later, if the site-wide administrator chooses to change permissions policy.

    These steps involve directly manipulating the acs_methods, acs_privileges, and acs_privilege_method_rules tables. A web page for manipulating these features should be limited to site-wide -administrators.

    "Modification of permissions" - involves fairly +administrators.

    "Modification of permissions" - involves fairly common operations. Users are typically able to administer permissions for objects they themselves create. The two basic operations here are -"grant" and "revoke". Granting permissions is done via +"grant" and "revoke". Granting permissions is done via acs_permissions.grant_permission, and revocation via acs_permissions.revoke_permission. These directly manipulate the acs_permissions table.

    Web pages for making these changes are available to all users, so they should not be in an admin area. In order to grant and revoke permissions on an object, the user must have the administer_privileges method -permission on that object.

    "Queries on permissions" - by far the most +permission on that object.

    "Queries on permissions" - by far the most common operation is querying the permissions database. Several kinds of -questions are commonly asked: First, and most commonly, "Can this party -perform this method on this object?" Two Tcl functions are provided to +questions are commonly asked: First, and most commonly, "Can this party +perform this method on this object?" Two Tcl functions are provided to answer this - one which returns a boolean, the other of which results in an error page. These tcl functions directly access the acs_object_party_method_map.

    The second most commonly asked question occurs when a list of objects is being displayed, often in order to provide appropriate UI functionality: -"For this party, what methods are available on these objects?" +"For this party, what methods are available on these objects?" Here, the SQL query needs to filter based on whether the party/user can perform some operation on the object. This is done via a join or sub-select against acs_object_party_method_map, or by calling the Tcl functions @@ -152,8 +153,8 @@ privilege acs_permissions.privilege%TYPE );

    These procedures are defined in -permissions-create.sql

    Tcl Procedures

    Two tcl procedures provide a simple call for the query, "Can this -user perform this method on this object?" One returns true or false, the +permissions-create.sql

    Tcl Procedures

    Two tcl procedures provide a simple call for the query, "Can this +user perform this method on this object?" One returns true or false, the other presents an error page.

    To receive a true or false value, Tcl code should call:

     ad_permission_p $object_id $object_type $method -user_id $user_id
     

    If the user_id argument is left out, then the currently logged in @@ -167,14 +168,14 @@ those privileges have been revoked.

    Granting permissions currently (as of 10/2000) works by providing a list of all possible permissions and a list of all parties in the system. (For large sites, some future search mechanism will be necessary.) After choosing -privileges to grant, the user is returned to the "edit privileges for -one object" screen.

    If it makes sense, the system will also display a checkbox which the user +privileges to grant, the user is returned to the "edit privileges for +one object" screen.

    If it makes sense, the system will also display a checkbox which the user may select to toggle whether permissions are inherited from the object's context.

    There are a number of potential future enhancements for the permissions UI, outlined below.

    Configuration/Parameters

    There are no configuration options for the permissions system.

    Future Improvements/Areas of Likely Change

    The most important future changes to the Permissions system are likely to be in the UI:

    • There should be a page displaying a list of all objects for which the current user is allowed to administer privileges.

    • Users should be able to view the permissions on any object, or perhaps on -objects which they have the "read_permissions" method. This would +objects which they have the "read_permissions" method. This would allow them to see what grants are affecting their objects through inheritance.

    Authors

    System creator