public function testBasicAuth() { $app = $this->getApp(); $fp = new FilePermissions($app); $this->assertTrue($fp->authorized('config', 'test.yml')); $this->assertFalse($fp->authorized('something', '/path/to/.htaccess')); }
/** * Returns whether you are authorized to do something with a file or directory. * * @param string $path * * @return bool */ public function handle($path) { $file = $this->filesystem->getFile($path); return $this->filePermissions->authorized($file->getMountPoint(), $file->getPath()); }