Skip to content
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

How to use WithFSConfig to specify read and write permissions that are not accessible under a folder? #1532

Closed
springrain opened this issue Jun 21, 2023 · 6 comments · Fixed by #1605
Labels
enhancement New feature or request

Comments

@springrain
Copy link

How to use WithFSConfig to specify read and write permissions that are not accessible under a folder?
for example, there are /data/read and /data/write under the /data folder, how to achieve /data/read readOnly, /data/write can be written?

@springrain springrain added the enhancement New feature or request label Jun 21, 2023
@evacchi
Copy link
Contributor

evacchi commented Jun 21, 2023

I don't think this is currently possible. You are able to mount a directory under the root and then specify rw access to those; e.g. /data_read, /data_write; at the moment it is not possible to mount sub-directories e.g. mount read under /data; it is a feature that has been requested though, so we may add support for it.

See #1525

@springrain
Copy link
Author

Mount the /data directory, how to specify read and write permissions to the subdirectories below it?

@evacchi
Copy link
Contributor

evacchi commented Jun 21, 2023

you can only set rw permissions at the mount level

		config = config.WithReadOnlyDirMount(dir, guestPath)

or

		config = config.WithDirMount(dir, guestPath)

@springrain
Copy link
Author

Thank you so much, I'm waiting for the new feature to be able to set subdirectory read and write permissions at the same time

@codefromthecrypt
Copy link
Contributor

after #1536 arbitrary nesting will be allowed (except GOOS=js).

However, I wouldn't suggest to make complex permission schemes via mounts. Other options are to set OS level permissions on the files.

Later when our filesystem API stabilizes, we'll expose it and this will allow you to control access to anything without having us change FSConfig for each sort of configuration.

@mathetake mathetake changed the title [question]:How to use WithFSConfig to specify read and write permissions that are not accessible under a folder? How to use WithFSConfig to specify read and write permissions that are not accessible under a folder? Jun 29, 2023
@codefromthecrypt
Copy link
Contributor

#1605 allows you to do whatever you want, and includes a read-only adapter example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants