Skip to content

Commit

Permalink
pkp#10748 fix user groups in site-wide registration (pkp#10750)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson authored Jan 8, 2025
1 parent 23b4712 commit d15e998
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions classes/user/form/UserFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @file classes/user/form/UserFormHelper.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2003-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class UserFormHelper
Expand All @@ -23,6 +23,7 @@
use PKP\security\Role;
use PKP\template\PKPTemplateManager;
use PKP\user\User;
use PKP\userGroup\UserGroup;

class UserFormHelper
{
Expand Down Expand Up @@ -63,9 +64,9 @@ public function assignRoleContent($templateMgr, $request)
if ($context->getData('disableUserReg')) {
continue;
}
$reviewerUserGroups[$context->getId()] = Repo::userGroup()->getByRoleIds([Role::ROLE_ID_REVIEWER], $context->getId())->toArray();
$authorUserGroups[$context->getId()] = Repo::userGroup()->getByRoleIds([Role::ROLE_ID_AUTHOR], $context->getId())->toArray();
$readerUserGroups[$context->getId()] = Repo::userGroup()->getByRoleIds([Role::ROLE_ID_READER], $context->getId())->toArray();
$reviewerUserGroups[$context->getId()] = UserGroup::withRoleIds([Role::ROLE_ID_REVIEWER])->withContextIds($context->getId())->get();
$authorUserGroups[$context->getId()] = UserGroup::withRoleIds([Role::ROLE_ID_AUTHOR])->withContextIds($context->getId())->get();
$readerUserGroups[$context->getId()] = UserGroup::withRoleIds([Role::ROLE_ID_READER])->withContextIds($context->getId())->get();
}
$templateMgr->assign([
'reviewerUserGroups' => $reviewerUserGroups,
Expand Down

0 comments on commit d15e998

Please sign in to comment.