/** * @test */ public function userActionIsDisallowedIfPermissionIsNotSet() { $this->prepareSubject(array()); $this->subject->setEvaluatePermissions(true); $this->subject->setUserPermissions(array('readFolder' => true)); $this->assertFalse($this->subject->checkUserActionPermission('write', 'folder')); }
/** * @test */ public function userActionIsDisallowedIfPermissionIsNotSet() { $this->prepareFixture(array()); $this->fixture->setEvaluatePermissions(TRUE); $this->fixture->setUserPermissions(array('readFolder' => TRUE)); $this->assertFalse($this->fixture->checkUserActionPermission('write', 'folder')); }
/** * The slot for the signal in ResourceFactory where storage objects are created * * @param ResourceFactory $resourceFactory * @param ResourceStorage $storage * @return void */ public function addUserPermissionsToStorage(ResourceFactory $resourceFactory, ResourceStorage $storage) { if (!$this->backendUserAuthentication->isAdmin()) { $storage->setEvaluatePermissions(true); if ($storage->getUid() > 0) { $storage->setUserPermissions($this->backendUserAuthentication->getFilePermissionsForStorage($storage)); } else { $storage->setEvaluatePermissions(false); } $this->addFileMountsToStorage($storage); } }