예제 #1
0
 /**
  * Fetch the roles that are associated with the user instance passed in.
  *
  * @todo cache roles
  * @param \RBAC\Subject\SubjectInterface $subject Initialized subject instance
  * @param bool $permissions Load the permission set
  * @return Role[] Roles the user has assigned
  */
 public function roleFetchSubjectRoles(SubjectInterface $subject, $permissions = true)
 {
     $roles = $this->storage->roleFetchSubjectRoles($subject, $permissions);
     if ($permissions) {
         $this->roleLoadPermissions($roles);
     }
     return $roles;
 }
예제 #2
0
 /**
  * Fetch the roles that are associated with the user instance passed in.
  *
  * @todo cache roles
  * @param \RBAC\Subject\SubjectInterface $subject Initialized subject instance
  * @return Role[] Roles the user has assigned
  */
 public function roleFetchSubjectRoles(SubjectInterface $subject)
 {
     $roles = $this->storage->roleFetchSubjectRoles($subject);
     $this->roleLoadPermissions($roles);
     return $roles;
 }