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

GeneralManager is able to add users to WM- #861

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(): GeneralManager is able to add users to WM-
If the "share with gorup members only" is checked, the GeneralManager is
not able to add users to the Workspace Manager group.

Signed-off-by: Baptiste Fotia <[email protected]>
zak39 committed Jun 16, 2023
commit e28f66f2bc4c3558e113e613252f3e712c960943
10 changes: 8 additions & 2 deletions lib/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
namespace OCA\Workspace\Service;

use OCA\Workspace\Db\SpaceMapper;
use OCA\Workspace\Service\Group\ManagersWorkspace;
use OCA\Workspace\Service\Group\UserGroup;
use OCA\Workspace\Service\Group\WorkspaceManagerGroup;
use OCP\IGroupManager;
@@ -43,7 +44,8 @@ public function __construct(
private IUserSession $userSession,
private LoggerInterface $logger,
private SpaceMapper $spaceMapper,
private UserService $userService
private UserService $userService,
private IUserSession $userSession
) {
}

@@ -123,7 +125,11 @@ public function autoComplete(string $term, array|string $space): array {
}
}

if ($this->shareManager->shareWithGroupMembersOnly()) {
if ($this->shareManager->shareWithGroupMembersOnly()
&& !$this->groupManager->isInGroup(
$this->userSession->getUser()->getUID(),
ManagersWorkspace::GENERAL_MANAGER)
) {
$users = $this->getUsersFromGroupsOnly($users);
}