fix: fixed create group link (#685)
This commit is contained in:
parent
ac791cfae6
commit
24f27294f0
2 changed files with 10 additions and 12 deletions
|
|
@ -6,18 +6,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "1081:1080"
|
- "1081:1080"
|
||||||
- "1026:1025"
|
- "1026:1025"
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "wget", "-qO-", "http://localhost:1080"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
adminer:
|
adminer:
|
||||||
image: adminer
|
image: adminer
|
||||||
ports:
|
ports:
|
||||||
- "8989:8080"
|
- "8989:8080"
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "curl --silent --fail http://127.0.0.1:8080/ || exit 1"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 30s
|
|
||||||
retries: 10
|
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ final class CreateGroupAction extends AbstractController
|
||||||
use FlashTrait;
|
use FlashTrait;
|
||||||
use GroupTrait;
|
use GroupTrait;
|
||||||
|
|
||||||
public const MAX_ELEMENT_BY_PAGE = 20;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly QueryBus $queryBus,
|
private readonly QueryBus $queryBus,
|
||||||
private readonly GroupRepository $groupRepository,
|
private readonly GroupRepository $groupRepository,
|
||||||
|
|
@ -61,6 +59,16 @@ final class CreateGroupAction extends AbstractController
|
||||||
)]
|
)]
|
||||||
public function createGroup(Request $request, #[CurrentUser] User $user): Response
|
public function createGroup(Request $request, #[CurrentUser] User $user): Response
|
||||||
{
|
{
|
||||||
|
// Admin must use the admin interface
|
||||||
|
if ($user->isAdmin()) {
|
||||||
|
return $this->redirect(
|
||||||
|
$this->adminUrlGenerator
|
||||||
|
->setController(GroupCrudController::class)
|
||||||
|
->set('crudAction', Crud::PAGE_NEW)
|
||||||
|
->generateUrl()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$configuration = $this->configurationRepository->getInstanceConfigurationOrCreate();
|
$configuration = $this->configurationRepository->getInstanceConfigurationOrCreate();
|
||||||
if (!$configuration->isGroupsCreationForAll()) {
|
if (!$configuration->isGroupsCreationForAll()) {
|
||||||
throw $this->createAccessDeniedException('Cannot create group with current settings.');
|
throw $this->createAccessDeniedException('Cannot create group with current settings.');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue