Commit 9fa4e9fc authored by Caluera's avatar Caluera Committed by Johannes

added if-clause to let only orga be able to delete accounts and not ambassadors

parent d3e7802d
Pipeline #105841237 passed with stages
in 13 minutes and 34 seconds
......@@ -67,6 +67,7 @@
- Show correct from/to information in mailboxes !1264 !1239 #603 @alex.simm
- Fix adding members to mailboxes by orga !1255 #677 @alex.simm
- Fix missing translations for MenuBasketsEntry. !1271 #761 @ctwx_ok
- disable delete account buttons for non-orga users !1279 @Caluera
## Refactoring
- refactored to use count() instead of more complicated expressions !1273 @Caluera
......
......@@ -83,14 +83,24 @@ class FoodsaverControl extends Control
$regionDetails = $fs['bezirk_id'] > 0 ? $this->regionGateway->getRegion($fs['bezirk_id']) : false;
$this->pageHelper->addContent($this->view->foodsaver_form($fs['name'] . ' ' . $fs['nachname'] . ' bearbeiten', $regionDetails));
$this->pageHelper->addContent($this->v_utils->v_field(
$this->v_utils->v_menu([
if ($this->session->may('orga')) {
$this->pageHelper->addContent($this->v_utils->v_field(
$this->v_utils->v_menu([
['href' => '/profile/' . $fs['id'], 'name' => $this->translationHelper->s('back_to_profile')],
['click' => 'fsapp.confirmDeleteUser(' . $fs['id'] . ')', 'name' => $this->translationHelper->s('delete_account')]
]),
$this->translationHelper->s('actions')),
CNT_RIGHT
);
} elseif ($this->session->isAmbassadorForRegion($regionIds, false, true)) {
$this->pageHelper->addContent($this->v_utils->v_field(
$this->v_utils->v_menu([
['href' => '/profile/' . $fs['id'], 'name' => $this->translationHelper->s('back_to_profile')],
['click' => 'fsapp.confirmDeleteUser(' . $fs['id'] . ')', 'name' => $this->translationHelper->s('delete_account')]
]),
$this->translationHelper->s('actions')),
]),
$this->translationHelper->s('actions')),
CNT_RIGHT
);
}
}
} else {
$this->pageHelper->addContent($this->v_utils->v_info('Du hast leider keine Berechtigung für diesen Bezirk'));
......
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