public function contains(Permitable $permitable) { if ($this->isEveryone || parent::contains($permitable)) { return true; } else { if ($permitable instanceof User) { foreach ($this->users as $user) { if ($user->isSame($permitable)) { return true; } } } foreach ($this->groups as $group) { if ($group->contains($permitable)) { return true; } } } return false; }