summaryrefslogtreecommitdiffstats
path: root/lib/private/Group
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-02-22 16:36:25 +0100
committerRobin Appelman <robin@icewind.nl>2019-02-25 16:06:09 +0100
commitdb750898ee3cb165218f4428265ab9dc258c93c2 (patch)
tree5a9e6472b98992b35b62ca7d5d1b1273f8466f48 /lib/private/Group
parentd7538f9a61a2af288d82fc257524aee5c2f86769 (diff)
downloadnextcloud-server-db750898ee3cb165218f4428265ab9dc258c93c2.tar.gz
nextcloud-server-db750898ee3cb165218f4428265ab9dc258c93c2.zip
allow group backends to mark that a group should now be shown in search dialogs
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Group')
-rw-r--r--lib/private/Group/Group.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php
index 0d54cf8e35a..df8de7af5d5 100644
--- a/lib/private/Group/Group.php
+++ b/lib/private/Group/Group.php
@@ -30,6 +30,7 @@
namespace OC\Group;
+use OCP\Group\Backend\IHideFromCollaborationBackend;
use OCP\GroupInterface;
use OCP\IGroup;
use OCP\IUser;
@@ -350,4 +351,14 @@ class Group implements IGroup {
}
return false;
}
+
+ /**
+ * @return bool
+ * @since 16.0.0
+ */
+ public function hideFromCollaboration(): bool {
+ return array_reduce($this->backends, function(bool $hide, GroupInterface $backend) {
+ return $hide | ($backend instanceof IHideFromCollaborationBackend && $backend->hideGroup($this->gid));
+ }, false);
+ }
}