aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Group
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-05 08:49:43 +0100
committerGitHub <noreply@github.com>2021-03-05 08:49:43 +0100
commit54cffefed47f7688800dbbb0d2115ddff02ebbef (patch)
treedf707ce13120ac23532370ecf5ead6173b0916a0 /lib/private/Group
parente6ef096e520c512064db3448696c7a3ab8f47147 (diff)
parent2796ef80ff53684c6b276b054bb2d3b6039a4ef6 (diff)
downloadnextcloud-server-54cffefed47f7688800dbbb0d2115ddff02ebbef.tar.gz
nextcloud-server-54cffefed47f7688800dbbb0d2115ddff02ebbef.zip
Merge pull request #25660 from hosting-de/feature/add-backend-list-groups
Show group backends in occ group:list --info and group:info
Diffstat (limited to 'lib/private/Group')
-rw-r--r--lib/private/Group/Database.php13
-rw-r--r--lib/private/Group/Group.php19
2 files changed, 31 insertions, 1 deletions
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php
index c49f3bce596..29fcb503b10 100644
--- a/lib/private/Group/Database.php
+++ b/lib/private/Group/Database.php
@@ -55,6 +55,7 @@ use OCP\Group\Backend\IGetDisplayNameBackend;
use OCP\Group\Backend\IGroupDetailsBackend;
use OCP\Group\Backend\IRemoveFromGroupBackend;
use OCP\Group\Backend\ISetDisplayNameBackend;
+use OCP\Group\Backend\INamedBackend;
use OCP\IDBConnection;
/**
@@ -69,7 +70,8 @@ class Database extends ABackend implements
IGetDisplayNameBackend,
IGroupDetailsBackend,
IRemoveFromGroupBackend,
- ISetDisplayNameBackend {
+ ISetDisplayNameBackend,
+ INamedBackend {
/** @var string[] */
private $groupCache = [];
@@ -502,4 +504,13 @@ class Database extends ABackend implements
return true;
}
+
+ /**
+ * Backend name to be shown in group management
+ * @return string the name of the backend to be shown
+ * @since 21.0.0
+ */
+ public function getBackendName(): string {
+ return 'Database';
+ }
}
diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php
index d3f8c603121..bb9a65de012 100644
--- a/lib/private/Group/Group.php
+++ b/lib/private/Group/Group.php
@@ -36,6 +36,7 @@ use OC\Hooks\PublicEmitter;
use OCP\Group\Backend\ICountDisabledInGroup;
use OCP\Group\Backend\IGetDisplayNameBackend;
use OCP\Group\Backend\IHideFromCollaborationBackend;
+use OCP\Group\Backend\INamedBackend;
use OCP\Group\Backend\ISetDisplayNameBackend;
use OCP\GroupInterface;
use OCP\IGroup;
@@ -318,6 +319,24 @@ class Group implements IGroup {
}
/**
+ * Get the names of the backend classes the group is connected to
+ *
+ * @return string[]
+ */
+ public function getBackendNames() {
+ $backends = [];
+ foreach ($this->backends as $backend) {
+ if ($backend instanceof INamedBackend) {
+ $backends[] = $backend->getBackendName();
+ } else {
+ $backends[] = get_class($backend);
+ }
+ }
+
+ return $backends;
+ }
+
+ /**
* delete the group
*
* @return bool