Changes between Version 3 and Version 4 of doc/developer/UserRolesArchitecture

Show
Ignore:
Timestamp:
12/05/06 23:22:12 (14 years ago)
Author:
benoitg
Comment:

Minor changes

Legend:

Unmodified
Added
Removed
Modified
  • doc/developer/UserRolesArchitecture

    v3 v4  
    6767 
    6868= API = 
     69Probably only two classes:  Roles and Security 
     70These function are to be prefered to the next ones, as they will throw exceptions to allow the user to login (or login as another user) to retry the operation: 
     71{{{ 
     72Security::requirePermission($permission, $target_object, $user);   
     73Security::requireEitherPermissions(array $permission, $target_object, $user); 
     74Security::requireAllPermissions(array $permission, $target_object, $user); 
     75}}} 
     76 
     77Internal implementation, and corner cases (gateway interaction maybe) 
     78{{{ 
    6979Security::hasPermission($permission, $target_object, $user);  //user is optional, if unspecified, the current user is used.  User can also be null, meaning that there is no user currently logged-in 
    7080Security::hasEitherPermissions(array $permission, $target_object, $user); 
    7181Security::hasAllPermissions(array $permission, $target_object, $user); 
     82}}} 
    7283 
    73 Security::requirePermission($permission, $target_object, $user);  //These function are to be prefered to the previous ones, as they will throw exceptions to allow the user to login (or login as another user) to retry the operation 
    74 Security::requireEitherPermissions(array $permission, $target_object, $user); 
    75 Security::requireAllPermissions(array $permission, $target_object, $user); 
    76  
     84Mostly for reporting 
     85{{{ 
    7786Security::getUsersWithPermission($permission, $target_object); //Return list of users with this permission 
    7887Security::getUsersWithRole($role, $object_id); //Return an array of users with the given role.  If objects_id is null, all users with the specific role are returned, along with an array of objects for which they have this role.  Maybe this function won't actually be implemented, as it's there mostly for reporting and sending notification of hotspots going down. 
    7988Security::getPermissions($user);  //returns array of PERMISSION constants for this user. 
    80  
     89}}} 
    8190= Data model = 
    82  
    83 == Data model == 
    8491permission_type table 
    8592 * permission_id