server icon indicating copy to clipboard operation
server copied to clipboard

Consider admin defaults when creating shares

Open nfebe opened this issue 1 year ago • 4 comments

The current share logic always uses the default BUNDLED_PERMISSIONS.ALL which includes everything. This commit updates share creation logic to use defaultPermissions if set by admin for the creation of new shares.

Resolves: https://github.com/nextcloud/server/issues/42835

nfebe avatar Jan 22 '24 14:01 nfebe

Something else that has come up while working on this in relation to maintaining "Allow editing" and "Default permissions"

  • It turns out when no permissions are set on the admin, the default permission is "1" which is ready only. So changing "Allow editing" to "Default permissions" which has the probability to be 1, most of the time would make little sense with read only just at the top, that is, "Read only" (first option), second option (Default permissions, still read only)

Screenshot from 2024-01-25 11-29-58

So, the brainstorming is not over it seems, the second path, is simply to add "Default permissions" as a new option IF it is different from READ only (1) as well as different from "Allow editing" (31)

nfebe avatar Jan 25 '24 10:01 nfebe

cc: @jancborchardt

nfebe avatar Jan 25 '24 10:01 nfebe

As far as I can see, the issue reported at https://github.com/nextcloud/server/issues/42835 should be fixed via code and does not need a new entry in this list of presets. These are merely default share permissions set by the admin and that’s that.

  • If the permissions set by the admin are the same as "View only", preselect that
  • If the permissions set by the admin are the same as "Allow editing", preselect that
  • If the permissions set by the admin are anything else, preselect "Custom permissions" with the relevant subline

But we should not replace an entry of those with "Default permissions" or anything like that.

jancborchardt avatar Jan 25 '24 14:01 jancborchardt

As far as I can see, the issue reported at https://github.com/nextcloud/server/issues/42835 should be fixed via code and does not need a new entry in this list of presets. These are merely default share permissions set by the admin and that’s that.

Sure, it does not necessarily need a new entry in the list of presets. But definitely needs making changes to how the presets work to avoid confusion. Adding another option or updating language are just other solutions paths suggested.

So the new implication is that "Allow editing" is not always the selected/default option as is the case now. It would be dynamically selected.

The only difference between this and my last suggestion is that no new entry would be added. To mitigate the issue of clearly understanding what default permissions are, I think it would be nice to have a way for the user to know that whatever permission was pres-elected for them is the default. This can be done by simply adding something like Default in parenthesis. (Default)

nfebe avatar Jan 25 '24 14:01 nfebe

/compile /

nfebe avatar Feb 01 '24 14:02 nfebe

/compile

CI is a bit slow at the moment due to 28.0.2 release I guess, you could short cut by compiling locally and submit the assets.

susnux avatar Feb 01 '24 14:02 susnux

/compile amend /

nfebe avatar Feb 01 '24 16:02 nfebe

PHP unit failures unrelated.

nfebe avatar Feb 01 '24 23:02 nfebe

/backport to stable28

nfebe avatar Feb 01 '24 23:02 nfebe

/backport to stable27

nfebe avatar Feb 01 '24 23:02 nfebe