diff --git a/lib/Users/UserFormatter.php b/lib/Users/UserFormatter.php index 2374c724e..39e58c9af 100644 --- a/lib/Users/UserFormatter.php +++ b/lib/Users/UserFormatter.php @@ -2,11 +2,17 @@ namespace OCA\Workspace\Users; +use OCA\Workspace\Service\Group\ConnectedGroupsService; use OCP\IGroupManager; +use OCP\IURLGenerator; use OCP\IUser; class UserFormatter { - public function __construct(private IGroupManager $groupManager) { + public function __construct( + private IGroupManager $groupManager, + private ConnectedGroupsService $connectedGroupsService, + private IURLGenerator $urlGenerator + ) { } /** @@ -32,6 +38,8 @@ public function formatUser(IUser $user, array $space, string $role): array { 'email' => $user->getEmailAddress(), 'subtitle' => $user->getEmailAddress(), 'groups' => $groups, + 'is_connected' => $this->connectedGroupsService->isUserConnectedGroup($user->getUID()), + 'profile' => $this->urlGenerator->linkToRouteAbsolute('core.ProfilePage.index', ['targetUserId' => $user->getUID()]), 'role' => $role ]; }