Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }