-
Notifications
You must be signed in to change notification settings - Fork 827
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
Local adapter private directory visibility #1762
Comments
Hi, @olegkhuss this is intended behaviour. The directory permissions are write-mostly, as in, they have a second priority to the other methods. It can be part of a directory listing, but is not required. The visibility method is intended to be used for files, which is why you're getting an unexpected result. In practice, for file storage needs, directories are not super important. It's when people use Flysystem as an API for specific local filesystem operations that this is ...problematic. |
I see, in V1 the behaviour was different, I'm migrating from V1 to V3 and
got this issue, but if that's intended, no issue then, thanks for clearing
that up! and Have a good weekend )
…On Fri, Mar 8, 2024, 19:32 Frank de Jonge ***@***.***> wrote:
Hi, @olegkhuss <https://github.com/olegkhuss> this is intended behaviour.
The directory permissions are write-mostly, as in, they have a second
priority to the other methods. It can be part of a directory listing, but
is not required. The visibility method is intended to be used for files,
which is why you're getting an unexpected result. In practice, for file
storage needs, directories are not super important. It's when people use
Flysystem as an API for specific local filesystem operations that this is
...problematic.
—
Reply to this email directly, view it on GitHub
<#1762 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2I4KAIIEIHH6LV24ZFHUTYXHDWZAVCNFSM6AAAAABEM2JAH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVG44TONBVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@olegkhuss for clarity, V3 optimised a lot of paths to reduce the amount of expensive calls while retaining (almost) all functionality. It's better for the performance of your app and better for the environmental impact of running software to do less. This is why it changed. |
So does it apply (V3 optimizations) to all adapters like Google cloud
storage? or just local adapter that is part of a flysystem?
…On Fri, Mar 8, 2024, 19:46 Frank de Jonge ***@***.***> wrote:
@olegkhuss <https://github.com/olegkhuss> for clarity, V3 optimised a lot
of paths to reduce the amount of expensive calls while retaining (almost)
all functionality. It's better for the performance of your app and better
for the environmental impact of running software to do less. This is why it
changed.
—
Reply to this email directly, view it on GitHub
<#1762 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2I4KAXIS5WW7YNH7WFN3LYXHFN7AVCNFSM6AAAAABEM2JAH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHAZDENBXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It seems to me a bug still, the permissions in the filesystem are set correctly $adapter = new LocalFilesystemAdapter(static::ROOT);
$adapter->createDirectory('public_directory', new Config(['visibility' => 'public']));
$publicVisibility = $adapter->visibility('public_directory');
$adapter->createDirectory('private_directory', new Config(['visibility' => 'private']));
$privateVisibility = $adapter->visibility('private_directory');
$this->assertEquals('public', $publicVisibility->visibility()); // okay
$this->assertEquals('private', $privateVisibility->visibility()); // ! failed, expect "private" but actual is "public" Now see the picture below, it returns me "public" in both cases whereas actual permissions are different? |
Hi guys, can you confirm this is really a bug, I created a test to reproduce it and a possible fix
Bug Report
Summary
When I create a directory with
['visibility' => 'private']
config and retrieve visibility it returns me "public" but I expect it to be "private"How to reproduce
The test above will fail, but I expect it to pass,
The test below will pass
The text was updated successfully, but these errors were encountered: