Esempio n. 1
0
 public function registerRole(Role $role, $connect = TRUE)
 {
     $this->roles[$role->getId()] = $role;
     if ($connect) {
         $role->connectToParent($this->roles);
         if (!$role->hasParent()) {
             $this->rootRoles[$role->getId()] = $role;
         }
     }
 }
Esempio n. 2
0
 protected function findCircle(Role $role, Role $parent)
 {
     if ($role->getId() == $parent->getId()) {
         return TRUE;
     } else {
         if ($parent->hasParent()) {
             return $this->findCircle($role, $parent->getParent());
         } else {
             return FALSE;
         }
     }
 }