/** * @param Permission $role * * @return bool */ public function hasPermission(Permission $role) { return $this->permissions->contains($role); }
/** * @param Permission $role */ public function addPermission(Permission $role) { $role->addUser($this); if (!$this->permissions->contains($role)) { $this->permissions[] = $role; } }
/** * {@inheritdoc} */ public function clearPermissions() { $this->permissions->clear(); $this->refreshPermissionsInstance(); }