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

fix: conflict in permissions for decisions for active members #1908

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion module/Application/view/partial/admin.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ use Laminas\View\Renderer\PhpRenderer;
</ul>
</li>
<?php endif; ?>
<?php if ($this->acl('decision_service_acl')->isAllowed('decision_admin', 'view')): ?>
<?php if ($this->acl('decision_service_acl')->isAllowed('decision_organ_admin', 'view')): ?>
<li>
<a href="<?= $this->url('admin_organ') ?>">
<?= $this->translate('Organs') ?>
Expand Down
1 change: 1 addition & 0 deletions module/Application/view/partial/main-nav.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ endif; ?>
$this->acl('activity_service_acl')->isAllowed('activity_admin', 'view')
|| $this->acl('company_service_acl')->isAllowed('company_admin', 'view')
|| $this->acl('decision_service_acl')->isAllowed('decision_admin', 'view')
|| $this->acl('decision_service_acl')->isAllowed('decision_organ_admin', 'view')
|| $this->acl('education_service_acl')->isAllowed('education_admin', 'view')
|| $this->acl('frontpage_service_acl')->isAllowed('frontpage_admin', 'view')
|| $this->acl('photo_service_acl')->isAllowed('photo_admin', 'view')
Expand Down
3 changes: 2 additions & 1 deletion module/Decision/src/Service/AclService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ protected function createAcl(): void
$this->acl->addResource(new Resource('gdpr'));
// Define administration part of this module, however, sub-permissions must be manually configured.
$this->acl->addResource(new Resource('decision_admin'));
$this->acl->addResource(new Resource('decision_organ_admin'));

// users are allowed to view the organs
$this->acl->allow('guest', 'organ', 'list');
$this->acl->allow('user', 'organ', 'view');

// Organ members are allowed to edit organ information of their own organs
$this->acl->allow('active_member', 'organ', 'edit');
$this->acl->allow('active_member', 'decision_admin', 'view');
$this->acl->allow('active_member', 'decision_organ_admin', 'view');

// users are allowed to view and search members
$this->acl->allow('user', 'member', ['view', 'view_self', 'search', 'birthdays']);
Expand Down
Loading