Пример #1
0
 /**
  * Deletes the token with the given uuid
  * 
  * @param \Zepi\Web\AccessControl\Entity\Token $token
  * @return boolean
  * 
  * @throws \Zepi\Core\AccessControl\Exception Cannot delete the token. Token does not exist.
  */
 public function deleteToken(Token $token)
 {
     // If the uuid does not exists we cannot delete the token
     if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $token->getUuid())) {
         throw new Exception('Cannot update the token. Token does not exist.');
     }
     // Delete the access entity
     return $this->accessControlManager->deleteAccessEntity($token);
 }
Пример #2
0
 /**
  * Deletes the user with the given uuid
  * 
  * @param \Zepi\Web\AccessControl\Entity\User $user
  * @return boolean
  * 
  * @throws \Zepi\Core\AccessControl\Exception Cannot delete the user. User does not exist.
  */
 public function deleteUser($user)
 {
     // If the uuid does not exists we cannot delete the user
     if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $user->getUuid())) {
         throw new Exception('Cannot delete the user. User does not exist.');
     }
     // Delete the access entity
     return $this->accessControlManager->deleteAccessEntity($user);
 }
Пример #3
0
 /**
  * Deletes the group with the given uuid
  *
  * @param \Zepi\Web\AccessControl\Entity\Group $group
  * @return boolean
  *
  * @throws \Zepi\Core\AccessControl\Exception Cannot delete the group. Group does not exist.
  */
 public function deleteGroup($group)
 {
     // If the uuid does not exists we cannot delete the group
     if (!$this->accessControlManager->hasAccessEntityForUuid(self::ACCESS_ENTITY_TYPE, $group->getUuid())) {
         throw new Exception('Cannot update the group. Group does not exist.');
     }
     // Delete the access entity
     return $this->accessControlManager->deleteAccessEntity($group);
 }