-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Prevent sharing with system groups #31578
Comments
Some requirements:
|
Possible approaches:
@jvillafanez any thoughts or suggestions ? |
Also to think about:
|
the dilemma is: either filter in the GroupManager and break pagination because we remove the blacklisted group in the middle or expect the group backend to filter based on given array of "to exclude" groups which needs touching every group backend but might be more efficient |
I'm discarding this. Scopes were mainly designed to give user / group backends some context for them to decide which users or groups should be returned. This would means that each backend should be doing the filtering instead of the sharing piece. The filtering should be done by the sharing piece because this is only related to sharing. Other components shouldn't care about this.
Discarding due to the same reason as above. I think the sharing API is part of the files_sharing app. This opens the possiblity to set this option as part of the sharing app instead of as part of core (shareManager and related classes) Viable options I see are:
An hybrid solution might be another option: core would provide the configuration option as well as prevent the sharing with those groups, meanwhile, the files_sharing app would reuse the configuration option to use it in the API and in the sharing autocomplete. If we opt for the hybrid solution we should consider to refactor the ShareManager to move the sharing configuration to another class. As said, adding more responsabilities to the ShareManager doesn't look good. |
@jvillafanez so if I understand correctly, if we go with the first option "Set the option as part of the files_sharing app." the restriction will be in place in:
In any case, if an app is requiring a user to specify a group, they'd better use the existing share autocomplete endpoint instead of providing their own. |
I think the latter solution "set the option as part of files_sharing app" is the one I tend to prefer despite the cons. If @tomneedham @butonic @DeepDiver1975 have no objections I suggest moving forward with this solution |
@tomneedham may have a stronger opinion because he used scopes for the support portal |
I don't understand the terminology here:
|
If by custom group you mean any other group backend: I was this to be true. So that an app can define a grouping of users as a |
@tomneedham with system group mostly is meaning as viewed by the system administrator: it could be an LDAP group containing all users from the system which is usually a group you don't want to expose for sharing. Not sure if there's a better name for that. With custom groups I mean groups from the "customgroups" app which are exposed with its own specific group backend. |
As things are right now, groups from the customgroups app should also be blacklisted. The reason is that sharing shouldn't care about the place where the groups come from, it just gets a list of groups from the group manager and blacklist them according to some rules. I agree that this is kind of bad because admin shouldn't blacklist groups created by the users. We'll need to figure out how can we deal with this properly. |
@jvillafanez I don't like How about have the option of adding a backend class name to blacklisted groups ? So the internal config setting would say something like "Group_LDAP::all_ldap_users_group". So we'd exclude by backend name. I believe you can retrieve the backend class/string from the |
That sounds better. Files_sharing would just blindly check it according to a predefined format |
I've updated the original post with: " add new setting for blacklisting groups from a specific backend: an array of "${backendClassName}::${groupName}" (exact format to be decided/improved)" |
Note that we might need to force the usage of the backendClassName. Since the backendClassName shouldn't have "::" in it, we have a clear separator between both components. Group names can have "::" in the name that would cause problems if we don't make the backendClassName mandatory. How are the admin going to modify the option?
I think this is the last piece before starting the development. |
I agree to make the backend class name mandatory for now. Regarding where to put the config, based on the roles: there are actually two admins, the system administrator who has FS access and can edit config.php and the OC admin who can configure users over the web UI and APIs, but no CLI access. Since configuring sharing and LDAP is usually an OC admin thing, I think we should provide a field in the sharing section and store into "oc_appconfig" under the "files_sharing" app as this is app specific.
@jvillafanez can you estimate both minimal and maximal version for the settings UI ? We should start with the backend change first and implement the UI last. (being able to set with |
I've updated the original post to include a note about the UI and the fact the backend class name is mandatory. |
|
@jvillafanez based on my own knowledge of the code I'd rather estimate as: minimal version: 0.5-1md and maximal version 2-4md as adding autocomplete in there can be copy pasted and then adjusted. Let's go with the minimal version for now within the main PR to make it easy to test. |
@jvillafanez anything else needed before you can start ? If not please summarize the various decisions into the original post. Thanks! |
This is ready. The original post has been updated with the decissions taken. |
Looks like we'll need to create new templates for the files_sharing app. Surprisingly, the app doesn't have any option; most of the sharing options seems to be controlled by core. |
Makes sense. The list will be below the textarea in case of small screens though. |
Why do we identify groups using displaynames? |
I think we need to make some text clearer. We already have:
And now we will have:
These sound similar, but as I understand it, the first one still allows receiving of shares? |
Can we not use exactly the same UI as the |
The two things are "opposite". Maybe: |
And can the UI / feel be exactly the same / next to each other? |
Can we guarantee that the group id IS unique across all the backends? As far as I know, the group id should be unique in a specific backend but right now it could be duplicated in other backends. Matching against the id won't be enough to uniquely identify an specific group. The reason to use the displayname is because it will be easier for the admin to know which group he wants to blacklist. The backend is there to specify that group in that backend, and not any other group with the same name that might be in any other backend. I've been checking if we could use |
Well then it seems we have some concepts we need to firm up:
My preference is that we implement this the same way as the current 'exclude groups from sharing' and rename the settings as @phil-davis suggested. Then refactor this to use dispalynames when it is possible . |
Can group id's contain commas? |
From what I see the PR was adjusted accordingly: #31672 I suggest to work on the acceptance tests separately:
|
One concern to confirm before closing this ticket: What happens if shares exist that were shared with a group that has now been blacklisted ? I assume these must still appear in the shares list and be unshareable by users. I don't think we need to add a mechanism to also exclude existing shares/mounts that point to blacklisted groups. |
docs ticket: owncloud-archive/documentation#4296 |
@phil-davis do we have all the required scenario steps to be able to test this ? Would suggest having @jvillafanez write said tests |
@phil-davis API level tests should be enough here I think |
Assigned myself to look at tests. OOTO for a few days though. |
I removed my assignment - tests were done in owncloud/QA#594 |
Any left here? @PVince81 or? |
System has internal groups (groups not for public use) that are important in OC
groups are useful for features like "exclude app from groups", "external storage with groups", whatever
but group must not be used for sharing, for example because it contains all system users so admin wants to exclude these
Filtering will be done by the files_sharing app. No changes in core should be required.
add new "oc_appconfig" setting for blacklisting groups from a specific backend: an array of "${backendClassName}::${groupName}". Backend class name is mandatory.
filter out results when querying groups to share based on blacklist
UI with autocomplete to set the name of groupsSettings page will include a textarea to enter the groups manually as specified above. No autocomplete will be provided for now.Need to find the right technical approach for this as there are many challenges.
Edited
The text was updated successfully, but these errors were encountered: