Commit ebb375dc authored by Peter Tönnies's avatar Peter Tönnies

Merge branch 'Feature/PT-makeReportsListAccesible'

parents e3822ed8 a9aa171a
Pipeline #83602812 passed with stages
in 11 minutes and 24 seconds
......@@ -94,7 +94,7 @@ final class RegionControl extends Control
['name' => 'group.members', 'href' => '/?page=bezirk&bid=' . $regionId . '&sub=members'],
];
if ($this->forumPermissions->mayAccessAmbassadorBoard($region['id']) && !$isWorkGroup) {
if (!$isWorkGroup && $this->forumPermissions->mayAccessAmbassadorBoard($regionId)) {
$menu[] = ['name' => 'terminology.ambassador_forum', 'href' => '/?page=bezirk&bid=' . $regionId . '&sub=botforum'];
}
......@@ -103,7 +103,7 @@ final class RegionControl extends Control
if ($region['has_children'] === 1) {
$menu[] = ['name' => 'terminology.subgroup', 'href' => '/?page=groups&p=' . $regionId];
}
if ($this->session->may('orga') || $this->session->isAdminFor($region['id'])) {
if ($this->session->isAdminFor($regionId) || $this->session->may('orga')) {
$menu[] = ['name' => 'Gruppe verwalten', 'href' => '/?page=groups&sub=edit&id=' . $regionId];
}
} else {
......@@ -114,9 +114,9 @@ final class RegionControl extends Control
$menu[] = ['name' => 'terminology.reports', 'href' => '/?page=report&bid=' . $regionId];
}
}
if ($this->mayAccessApplications($region['id'])) {
if ($requests = $this->gateway->listRequests($region['id'])) {
$menu[] = ['name' => $this->translator->trans('group.applications') . ' (' . count($requests) . ')', 'href' => '/?page=bezirk&bid=' . $region['id'] . '&sub=applications'];
if ($this->mayAccessApplications($regionId)) {
if ($requests = $this->gateway->listRequests($regionId)) {
$menu[] = ['name' => $this->translator->trans('group.applications') . ' (' . count($requests) . ')', 'href' => '/?page=bezirk&bid=' . $regionId . '&sub=applications'];
}
}
......
......@@ -23,9 +23,9 @@ class ReportPermissions
*
*/
return
$this->session->isOrgaTeam() ||
$this->session->isAdminFor($regionId) ||
/* ToDo: Need to check that regionId is a subgroup of europe. implied for now. */
$this->session->isOrgaTeam() ||
$this->session->mayGroup(RegionIDs::EUROPE_REPORT_TEAM)
;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment