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

Allow blocking of group sharing #23398

Merged
merged 6 commits into from Mar 22, 2016
Merged

Allow blocking of group sharing #23398

merged 6 commits into from Mar 22, 2016

Conversation

rullzer
Copy link
Contributor

@rullzer rullzer commented Mar 18, 2016

Fixes https://github.com/owncloud/enterprise/issues/1079
FYI: @cmonteroluque @MTRichards @cdamken

This introduces an extra config variable to core.
If disabled the share API will block group shares (and the manager as well to avoid apps doing group shares).
It also disables the sharee API to disable group shares

Tests are updated and extended.

Please review: @PVince81 @nickvergessen @MorrisJobke

@@ -264,6 +264,10 @@ public function createShare() {
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
} else if ($shareType === \OCP\Share::SHARE_TYPE_GROUP) {
if (!$this->shareManager->allowGroupSharing()) {
return new \OC_OCS_Result(null, 404, 'group sharing is disabled by the administrator');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove the administrator part, that's obvious for each "disabled"setting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just there out of consistency... (it is basically the same message as for disabled public upload etc)

@ghost
Copy link

ghost commented Mar 18, 2016

+1

@nickvergessen
Copy link
Contributor

Integration tests missing :shocked: :P

@rullzer
Copy link
Contributor Author

rullzer commented Mar 19, 2016

Yeah... That is what you get with all this last minute stuff...

@rullzer
Copy link
Contributor Author

rullzer commented Mar 19, 2016

@nickvergessen but good idea... will tackle that on monday

* @return bool
* @since 9.0.1
*/
public function allowGroupSharing();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hope no one implemented their own ShareManager in 9.0.0 😉
I guess this addition should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They could but then they would have to patch core anyways... we only support custom shareProviders ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A less-bc-breaking approach would have been to have a getOptions() method which returns an array. This way we can expose the options in the future without breaking the interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must say I like that...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But has the disadvantage of missing type hints. Could do it like with storages and add seperate interfaces which you can type hint against?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - we already have a ton of methods like this ...... 👍

@PVince81
Copy link
Contributor

Code looks good so far. Will have a quick test later after integration tests popped up. 😄

@nickvergessen
Copy link
Contributor

👍

@PVince81
Copy link
Contributor

Tested, works.

Small things:

  • there is an extra dot in the label of the checkbox in the admin page (others don't have the dot)
  • placeholder in share panel should say "Share with users or remote users" (without groups) when group sharing is disabled

Maybe there are other locations that need adjusting ?

@PVince81
Copy link
Contributor

and something fishy with the integration tests:

And apps returned are:

Failed asserting that two arrays are equal.

@nickvergessen
Copy link
Contributor

Scenario: Remote sharee for calendars not allowed

fails ❌

@rullzer
Copy link
Contributor Author

rullzer commented Mar 21, 2016

Aah that is appareantly because the sharing stuff is a trait and not a class... so the afterScenario stuff is not called... :S

@rullzer
Copy link
Contributor Author

rullzer commented Mar 21, 2016

My behat fu is not good enough here. I have a feeling we need to define a proper shareContext. And not just have it as a trait. Because for some reason then everything goes wrong...

@nickvergessen lets discuss tomorrow

@rullzer rullzer force-pushed the block_group_sharing branch 2 times, most recently from 5839912 to 213248f Compare March 22, 2016 07:55
@rullzer
Copy link
Contributor Author

rullzer commented Mar 22, 2016

Ok we need to do some more refactoring in the tests to get them to work. So discussed with @nickvergessen and no share intergration tests for now... to make sure we can still backport this.

@nickvergessen
Copy link
Contributor

My 👍 stands, @PVince81 ?

@PVince81
Copy link
Contributor

👍

@PVince81
Copy link
Contributor

@karlitschek backport to 9.0.1 ?

@rullzer
Copy link
Contributor Author

rullzer commented Mar 22, 2016

@karlitschek backport to 9.0.1 ?

Required for https://github.com/owncloud/enterprise/issues/1079

@karlitschek
Copy link
Contributor

please backport

@rullzer
Copy link
Contributor Author

rullzer commented Mar 22, 2016

Stable 9 in #23473

@DeepDiver1975
Copy link
Member

@rullzer conflicting - please rebase - THX

@MorrisJobke
Copy link
Contributor

Tested and works 👍

@rullzer
Copy link
Contributor Author

rullzer commented Mar 22, 2016

@DeepDiver1975 done... the mysql failure is the known one..

DeepDiver1975 added a commit that referenced this pull request Mar 22, 2016
@DeepDiver1975 DeepDiver1975 merged commit d5be21f into master Mar 22, 2016
@DeepDiver1975 DeepDiver1975 deleted the block_group_sharing branch March 22, 2016 20:28
@lock
Copy link

lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants