Skip to content

Commit

Permalink
Merge pull request #1899 from tomudding/feature/user-activated-flag
Browse files Browse the repository at this point in the history
feat: member and user administrative overview
  • Loading branch information
tomudding authored Sep 11, 2024
2 parents e0c3e75 + 1a7115e commit 1880ea2
Show file tree
Hide file tree
Showing 21 changed files with 366 additions and 108 deletions.
2 changes: 1 addition & 1 deletion module/Activity/src/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function externalSignoffAction(): Response|ViewModel
*/
public function viewAction(): ViewModel
{
if (!$this->aclService->isAllowed('viewAdmin', 'activity')) {
if (!$this->aclService->isAllowed('view', 'activity_admin')) {
throw new NotAllowedException($this->translator->translate('You are not allowed to administer activities'));
}

Expand Down
20 changes: 12 additions & 8 deletions module/Activity/src/Service/AclService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Activity\Service;

use Laminas\Permissions\Acl\Resource\GenericResource as Resource;
use User\Permissions\Assertion\IsCreatorOrOrganMember;

class AclService extends \User\Service\AclService
Expand All @@ -12,13 +13,15 @@ protected function createAcl(): void
{
parent::createAcl();

$this->acl->addResource('activity');
$this->acl->addResource('activityApi');
$this->acl->addResource('myActivities');
$this->acl->addResource('model');
$this->acl->addResource('activity_calendar_period');
$this->acl->addResource('activity_calendar_proposal');
$this->acl->addResource('signupList');
$this->acl->addResource(new Resource('activity'));
$this->acl->addResource(new Resource('activityApi'));
$this->acl->addResource(new Resource('myActivities'));
$this->acl->addResource(new Resource('model'));
$this->acl->addResource(new Resource('activity_calendar_period'));
$this->acl->addResource(new Resource('activity_calendar_proposal'));
$this->acl->addResource(new Resource('signupList'));
// Define administration part of this module, however, sub-permissions must be manually configured.
$this->acl->addResource(new Resource('activity_admin'));

$this->acl->allow('guest', 'activity', ['view', 'viewCategory']);
$this->acl->allow('guest', 'signupList', ['view', 'externalSignup']);
Expand All @@ -35,7 +38,7 @@ protected function createAcl(): void
['view', 'viewDetails', 'signup', 'signoff', 'checkUserSignedUp'],
);

$this->acl->allow('active_member', 'activity', ['create', 'viewAdmin', 'listCategories']);
$this->acl->allow('active_member', 'activity', ['create', 'listCategories']);
$this->acl->allow(
'active_member',
'activity',
Expand All @@ -48,6 +51,7 @@ protected function createAcl(): void
['adminSignup', 'viewParticipants', 'exportParticipants'],
new IsCreatorOrOrganMember(),
);
$this->acl->allow('active_member', 'activity_admin', 'view');

$this->acl->allow('admin', 'activity', 'viewParticipantDetails');
$this->acl->allow('admin', 'activity', 'approve');
Expand Down
27 changes: 24 additions & 3 deletions module/Application/language/en.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions module/Application/language/gewisweb.pot

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions module/Application/language/nl.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1880ea2

Please sign in to comment.