Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a275735 authored by Alexandre Roux's avatar Alexandre Roux
Browse files

Apply 1 suggestion(s) to 1 file(s)

parent ad7426a1
Loading
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -83,10 +83,15 @@ class Application extends App implements IBootstrap {
	public function addStorageWrapper(): void {
		$userSession = \OC::$server->get(IUserSession::class);
		$currentUser = $userSession->getUser();
		if ($currentUser !== null) {
		if ($currentUser === null) {
                        Filesystem::addStorageWrapper('ecloud-accounts', [$this, 'addStorageWrapperCallback'], -10);
                        return;
                }

		$groupManager = \OC::$server->get(IGroupManager::class);
		$groups = $groupManager->getUserGroups($currentUser);
		$hasAccess = false;
		
                if (!empty($groups)) {
			foreach ($groups as $group) {
				if($group->getGID() === "storage_enable") {
@@ -95,6 +100,7 @@ class Application extends App implements IBootstrap {
				}
			}
		}
			
                if(!$hasAccess) { 
			Filesystem::addStorageWrapper('ecloud-accounts', [$this, 'addStorageWrapperCallback'], -10);
		}