Check access on sidebar action menus

This commit is contained in:
Frederic Guillot 2016-02-10 19:41:08 -05:00
parent a46757778f
commit 33214bdb52
1 changed files with 11 additions and 6 deletions

View File

@ -1,9 +1,11 @@
<div class="sidebar">
<h2><?= t('Information') ?></h2>
<ul>
<li <?= $this->app->checkMenuSelection('user', 'show') ?>>
<?= $this->url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
</li>
<?php if ($this->user->hasAccess('user', 'show')): ?>
<li <?= $this->app->checkMenuSelection('user', 'show') ?>>
<?= $this->url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<?php if ($this->user->isAdmin()): ?>
<li>
<?= $this->url->link(t('User dashboard'), 'app', 'index', array('user_id' => $user['id'])) ?>
@ -30,9 +32,12 @@
<h2><?= t('Actions') ?></h2>
<ul>
<?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?>
<li <?= $this->app->checkMenuSelection('user', 'edit') ?>>
<?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
</li>
<?php if ($this->user->hasAccess('user', 'edit')): ?>
<li <?= $this->app->checkMenuSelection('user', 'edit') ?>>
<?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<?php if ($user['is_ldap_user'] == 0): ?>
<li <?= $this->app->checkMenuSelection('user', 'password') ?>>