You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Mark mount as read only in the mount settings #29873
If you mount a storage, it could be that the user has no write rights.
It is not when we do sharing where we can already set a read only flag which we further do/could use (see later).
It targets those mounts where the accessing user with his credentials has no rights to write to. This is handled by the accessed storage and not by owncloud.
I am only talking on full mounts and not about possible different subfolder permissions !
Because we do not see this write disability, a user might try to write into and gets a error message that does not give him the proper cause. If I remember correctly, if we have a shared read only mount, the error message is correct and helpful.
Thinking further, this is also true for the user at the client who has no clue why he can´t write to a mount - and if he does he can do into the client´s filesystem but the data never gets synced.
I do not know if a read only marker for a read only mount gets currently already propagated to the client. If not this should be done and if yes this FR is only an extension if set on the mount. But anyways this is a part of core to do so and a part of the client to take an action which is to be determined.
Proposal:
Adding the ability to mark a storage as read only.
Adding a read-only checkbox might actually be a good idea.
The way I see it is that we'd apply the permissions mask storage wrapper on top of that storage to return read-only permissions. So only isReadable() would return true but isCreatable(), and isUpdateable() would return false. I expect the other layers of ownCloud to be able to adjust accordingly and hide write perms everywhere, just like for read-only shares.
For the technical implementation, whenever the mount has been flagged as "read-only", use the "PermissionsMask" storage wrapper and apply it on this storage.
For your item 3, when I did the test with ftp (see: #29999 (comment)) you can set permissions for files and directories seperated. Knowing this, a test should check both and if one fails, autodetection should go for read only...
I have completed the first two tasks, but I have not figured out how to write tests yet. I did find some documentation, but hints, like for the second task, would be appreciated.
I want to push my branch, so you can see whether I need to do more, but I get a permission denied. Who do I need to ask to grant me permission to do so?
Activity
ownclouders commentedon Dec 17, 2017
GitMate.io thinks the contributor most likely able to help you is @PVince81.
PVince81 commentedon Dec 18, 2017
Adding a read-only checkbox might actually be a good idea.
The way I see it is that we'd apply the permissions mask storage wrapper on top of that storage to return read-only permissions. So only
isReadable()would return true butisCreatable(), andisUpdateable()would return false. I expect the other layers of ownCloud to be able to adjust accordingly and hide write perms everywhere, just like for read-only shares.mmattel commentedon Dec 31, 2017
Based on #29999, if implemented:
PVince81 commentedon Jan 9, 2018
Sounds good.
For the technical implementation, whenever the mount has been flagged as "read-only", use the "PermissionsMask" storage wrapper and apply it on this storage.
Some example on how to apply a storage wrapper based on mount config can be found here where we do it for NFD compatibility: https://github.com/owncloud/core/blob/v10.0.3/lib/private/legacy/util.php#L194.
So the tasks would be as follows:
PermissionsMaskstorage wrapper following the example from https://github.com/owncloud/core/blob/v10.0.3/lib/private/legacy/util.php#L194 and make it so that the permissions are read-onlymmattel commentedon Jan 9, 2018
For your item 3, when I did the test with ftp (see: #29999 (comment)) you can set permissions for files and directories seperated. Knowing this, a test should check both and if one fails, autodetection should go for read only...
mmattel commentedon May 2, 2018
@PVince81 any update on this?
mmattel commentedon May 30, 2018
@PVince81 any update on this?
PVince81 commentedon May 30, 2018
not scheduled yet
TJHeeringa commentedon Sep 7, 2018
@PVince81 any update on this?
PVince81 commentedon Sep 10, 2018
This is currently not a priority and we haven't received any contribution with that feature yet.
If anyone feels like implementing it, I've put some hints above.
TJHeeringa commentedon Sep 28, 2018
I have completed the first two tasks, but I have not figured out how to write tests yet. I did find some documentation, but hints, like for the second task, would be appreciated.
I want to push my branch, so you can see whether I need to do more, but I get a permission denied. Who do I need to ask to grant me permission to do so?
phil-davis commentedon Sep 29, 2018
I do not have the jedi powers to grant you branch create access in the owncloud repo. @PVince81 or @DeepDiver1975 can do that.
But you can contribute from your own fork, and make PRs from there - CI will run fine. The process is like:
git pushwhich will go up to you fork by defaultmmattel commentedon Nov 28, 2018
@TJHeeringa may I ping you again ?
mmattel commentedon Dec 13, 2018
🔉 Ping