Esempio n. 1
0
 /**
  * @brief Retrieve the effective access on the object
  *
  * If the subject is not specified, the current user will be used.
  *
  * @param IAclObject $object The object to for which the access is queried
  * @param IAclSubject $subject The subject whos access is being queried
  * @return Array The effective access for each of the roles
  */
 static function getEffectiveAccess(IAclObject $object, IAclSubject $subject = null)
 {
     // If the subject is not specified, set it to the current user.
     if (!$subject) {
         $subject = user::getActiveUser();
     }
     $am = acl::getAccessMatrix($object, $subject);
     $ar = end($am);
     return $ar['roles'];
 }