/** * Updates the given token * * @param \Zepi\Web\AccessControl\Entity\Token $token * @return boolean * * @throws \Zepi\Core\AccessControl\Exception Cannot update the token. Token does not exist. */ public function updateToken(Token $token) { // If the uuid does not exists we cannot update the token if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $token->getUuid())) { throw new Exception('Cannot update the token. Token does not exist.'); } // Add the access entity return $this->accessControlManager->updateAccessEntity($token); }
/** * Updates the given user * * @param \Zepi\Web\AccessControl\Entity\User $user * @return boolean * * @throws \Zepi\Core\AccessControl\Exception Cannot update the user. User does not exist. */ public function updateUser(User $user) { // If the uuid does not exists we cannot update the user if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $user->getUuid())) { throw new Exception('Cannot update the user. User does not exist.'); } // Add the access entity return $this->accessControlManager->updateAccessEntity($user); }
/** * Updates the given Group * * @param \Zepi\Web\AccessControl\Entity\Group $group * @return boolean * * @throws \Zepi\Core\AccessControl\Exception Cannot update the group. The group does not exist. */ public function updateGroup(Group $group) { // If the uuid does not exists we cannot update the group if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $group->getUuid())) { throw new Exception('Cannot update the group. The group does not exist.'); } // Update the access entity return $this->accessControlManager->updateAccessEntity($group); }