From 18c5ceb523a49004d4307014362f4ca5521d1bf9 Mon Sep 17 00:00:00 2001 From: Ercan Ozkaya Date: Fri, 19 Dec 2014 14:10:53 +0200 Subject: [PATCH] Revert "re #186: Add UserAbstract::hasRole and UserAbstract::hasRoles" This reverts commit 9f94a671a9454d6b6714826e154ba64f474ff556. --- .../koowa/libraries/user/abstract.php | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/code/libraries/koowa/libraries/user/abstract.php b/code/libraries/koowa/libraries/user/abstract.php index 1fb5341c2..32079a353 100644 --- a/code/libraries/koowa/libraries/user/abstract.php +++ b/code/libraries/koowa/libraries/user/abstract.php @@ -126,30 +126,6 @@ public function getRoles() return KObjectConfig::unbox($this->getData()->roles); } - /** - * Checks if the user has a role. - * - * @param mixed|array $roles A role name or an array containing role identifiers. - * @return bool True if the user has at least one of the provided roles, false otherwise. - */ - public function hasRole($roles) - { - $roles = (array) $roles; - return (bool) array_intersect($this->getRoles(), $roles); - } - - /** - * Checks if the user has a set of roles. - * - * @param array $roles An array containing role identifiers. - * @return bool True if the user has all of the provided roles, false otherwise. - */ - public function hasRoles($roles) - { - $roles = (array) $roles; - return count(array_intersect(array_unique($this->getRoles()), $roles)) === count($roles); - } - /** * Returns the groups the user is part of *