.

UsersAccessControl Class Reference
[Usermanagement]

User Access Control for Users. More...

Inheritance diagram for UsersAccessControl:
AccessControlBase IAccessControl

List of all members.

Public Member Functions

  __construct ()
  Constructor.

Protected Member Functions

  do_is_allowed_for_anonymous ($action, $item, $params=false)
  Overloadable.
  do_is_allowed_for_user ($action, $item, $user, $params=false)
  Overloadable.

Detailed Description

User Access Control for Users.

Author:
Gerd Riesselmann

Definition at line 8 of file users.access.php.


Constructor & Destructor Documentation

UsersAccessControl::__construct (  ) 

Constructor.

Sets type on parent.

Definition at line 12 of file users.access.php.

00012                                       {
00013                 parent::__construct('users');
00014         }

Member Function Documentation

UsersAccessControl::do_is_allowed_for_anonymous ( action,
item,
params = false  
) [protected]

Overloadable.

Check if action on object is allowed for no user

Parameters:
string  $action The action to perform (edit, delete, ....)
mixed  $item Item to perform the action on (may be a DataObject, e.g.)
Returns:
int One of Constants ALLOWED, NOT_ALLOWED and NOT_RESPONSIBLE

Reimplemented from AccessControlBase.

Definition at line 50 of file users.access.php.

00050                                                                                         {
00051                 return self::NOT_ALLOWED;
00052         }       
UsersAccessControl::do_is_allowed_for_user ( action,
item,
user,
params = false  
) [protected]

Overloadable.

Check if action on object is allowed for given user

User is always valid

Parameters:
string  $action The action to perform (edit, delete, ....)
mixed  $item Item to perform the action on (may be a DataObject, e.g.)
DAOUsers  $user A user, role, ACO, depending on user management chosen
Returns:
int One of Constants ALLOWED, NOT_ALLOWED and NOT_RESPONSIBLE

Reimplemented from AccessControlBase.

Definition at line 26 of file users.access.php.

00026                                                                                           {
00027                 // we know that item is of type "users"
00028                 $ret = self::NOT_ALLOWED;
00029                 $is_admin = $user->has_role(array(USER_ROLE_ADMIN, USER_ROLE_SYSTEM)); 
00030                 switch ($action) {
00031                         case 'update':
00032                                 $ret = $this->to_result(($is_admin) || ($item->id == $user->id));
00033                                 break;
00034                         case 'create':
00035                         case 'status':
00036                         case 'edit':
00037                                 $ret = $this->to_result($is_admin);
00038                                 break;
00039                 }
00040                 return $ret;            
00041         }

The documentation for this class was generated from the following file: