예제 #1
0
 /**
  * @test
  */
 public function userActionIsDisallowedIfPermissionIsNotSet()
 {
     $this->prepareSubject(array());
     $this->subject->setEvaluatePermissions(true);
     $this->subject->setUserPermissions(array('readFolder' => true));
     $this->assertFalse($this->subject->checkUserActionPermission('write', 'folder'));
 }
예제 #2
0
 /**
  * @test
  */
 public function userActionIsDisallowedIfPermissionIsNotSet()
 {
     $this->prepareFixture(array());
     $this->fixture->setEvaluatePermissions(TRUE);
     $this->fixture->setUserPermissions(array('readFolder' => TRUE));
     $this->assertFalse($this->fixture->checkUserActionPermission('write', 'folder'));
 }
예제 #3
0
 /**
  * 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);
     }
 }