-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File owner / group / permissions #8
Comments
Here, 0644 is an example of file permissions. You can customize it based on your requirements.
The third parameter true indicates that the operation should be performed recursively. Remember to replace 'newOwner', 'newGroup', 'file.txt', and 'folder' with the actual values and file/folder names you’re working with. |
Thanks a lot for the detailed answer. However, in my app I have to access the files in the workspace with a certain user e.g. with uid=1000. By default the workspace is created with "drwx------ 3 www-data www-data". Files are created with "-rw-r--r-- 1 www-data www-data". Now I would need to place a hook into the VueFinder.php on every file / folder create / change and change the permissions or owner or group. I think this is not the best way to do it. So, I'm wondering if there is rather a global setting for the permissions. From Laravel I could do this: 'local' => [ Maybe this is the solution, I have to try. I could change the permissions to 0777, then my user with uid=1000 has full access. But still owner:group is www-data:www-data. Ok I have to try. Cheers. |
Ok, I tried that, but it only has an effect on Laravel's Storage, e.g. creating a file |
Hi, //add PortableVisibilityConverter
use League\Flysystem\UnixVisibility\PortableVisibilityConverter;
//set umask
umask(0000);
// Set VueFinder class
$vuefinder = new VueFinder([
'local' => new LocalFilesystemAdapter(
dirname(__DIR__).'/storage',
PortableVisibilityConverter::fromArray([
'file' => [
'public' => 0777, //no effect
'private' => 0777, //no effect
],
'dir' => [
'public' => 0777,
'private' => 0777, //this is used
],
]),
),
]); The crucial point is to set the umask. I don't understand it fully, the PortableVisibilityConverter has no effect on files, but on private folders. Anyway for files the new umask is used, which is 666 (-rw-rw-rw-). For folders it is 777 (drwxrwxrwx). Still owner and group is www-data. This works now for me, I can access the files and folders with another user. |
Hi,
first of all, I would like to say thank you for this great package. I have successfully included it into a Laravel App. However, I wanted to ask if you can give me a hint to change the owner, the group and the file permissions for created and uploaded files and folders.
Thanks and kind regards,
Sebastian
The text was updated successfully, but these errors were encountered: