diff options
author | Baptiste Fotia <fotia.baptiste@hotmail.com> | 2022-10-11 16:21:06 +0300 |
---|---|---|
committer | Baptiste Fotia <fotia.baptiste@hotmail.com> | 2022-10-11 16:21:06 +0300 |
commit | f7fbdd7ae0686a470ffc4e75650b1233cb672f98 (patch) | |
tree | 3759966800411c06748c1410efbb1618f34b95cf /lib/Service/DelegationService.php | |
parent | 58119163e47f3e998648a35b22f0cafacd57fe20 (diff) |
chore(Middleware,Service): Clean vars not used
I deleted vars that are no longer used and sort the namespaces by
ascendant order.
Signed-off-by: Baptiste Fotia <fotia.baptiste@hotmail.com>
Diffstat (limited to 'lib/Service/DelegationService.php')
-rw-r--r-- | lib/Service/DelegationService.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/Service/DelegationService.php b/lib/Service/DelegationService.php index 5a58841e..363a4810 100644 --- a/lib/Service/DelegationService.php +++ b/lib/Service/DelegationService.php @@ -24,8 +24,6 @@ namespace OCA\GroupFolders\Service; use OC\Settings\AuthorizedGroupMapper; use OCA\GroupFolders\Controller\DelegationController; use OCA\GroupFolders\Settings\Admin; -use OCA\Settings\Service\AuthorizedGroupService; -use OCP\IConfig; use OCP\IGroupManager; use OCP\IUserSession; @@ -41,24 +39,18 @@ class DelegationService { */ private const CLASS_API_ACCESS = DelegationController::class; - private AuthorizedGroupService $authorizedGroupService; - private IConfig $config; + private AuthorizedGroupMapper $groupAuthorizationMapper; private IGroupManager $groupManager; private IUserSession $userSession; - private AuthorizedGroupMapper $groupAuthorizationMapper; public function __construct( - AuthorizedGroupService $authorizedGroupService, - IConfig $config, + AuthorizedGroupMapper $groupAuthorizationMapper, IGroupManager $groupManager, - IUserSession $userSession, - AuthorizedGroupMapper $groupAuthorizationMapper + IUserSession $userSession ) { - $this->authorizedGroupService = $authorizedGroupService; - $this->config = $config; + $this->groupAuthorizationMapper = $groupAuthorizationMapper; $this->groupManager = $groupManager; $this->userSession = $userSession; - $this->groupAuthorizationMapper = $groupAuthorizationMapper; } /** @@ -72,7 +64,6 @@ class DelegationService { * @return bool true if the user is a delegated admin */ public function isDelegatedAdmin(): bool { - $authorized = false; return $this->getAccessLevel([ self::CLASS_NAME_ADMIN_DELEGATION, ]); @@ -100,7 +91,7 @@ class DelegationService { ]); } - private function getAccessLevel(array $settingClasses) { + private function getAccessLevel(array $settingClasses): bool { $authorized = false; $authorizedClasses = $this->groupAuthorizationMapper->findAllClassesForUser($this->userSession->getUser()); foreach ($settingClasses as $settingClass) { |