Acl refactoring

This commit is contained in:
Frédéric Guillot
2014-12-31 12:37:15 -05:00
parent 66f150d887
commit 772804add8
93 changed files with 943 additions and 626 deletions

View File

@@ -20,7 +20,7 @@
<?= $this->formLabel(t('Default project'), 'default_project_id') ?>
<?= $this->formSelect('default_project_id', $projects, $values, $errors) ?><br/>
<?php if ($this->acl->isAdminUser()): ?>
<?php if ($this->userSession->isAdmin()): ?>
<?= $this->formCheckbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?><br/>
<?php endif ?>

View File

@@ -6,7 +6,7 @@
<h3><i class="fa fa-google"></i> <?= t('Google Account') ?></h3>
<p class="listing">
<?php if ($this->acl->isCurrentUser($user['id'])): ?>
<?php if ($this->userSession->isCurrentUser($user['id'])): ?>
<?php if (empty($user['google_id'])): ?>
<?= $this->a(t('Link my Google Account'), 'user', 'google', array(), true) ?>
<?php else: ?>
@@ -22,7 +22,7 @@
<h3><i class="fa fa-github"></i> <?= t('Github Account') ?></h3>
<p class="listing">
<?php if ($this->acl->isCurrentUser($user['id'])): ?>
<?php if ($this->userSession->isCurrentUser($user['id'])): ?>
<?php if (empty($user['github_id'])): ?>
<?= $this->a(t('Link my GitHub Account'), 'user', 'github', array(), true) ?>
<?php else: ?>

View File

@@ -1,6 +1,6 @@
<section id="main">
<div class="page-header">
<?php if ($this->acl->isAdminUser()): ?>
<?php if ($this->userSession->isAdmin()): ?>
<ul>
<li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New user'), 'user', 'create') ?></li>
</ul>

View File

@@ -1,6 +1,6 @@
<section id="main">
<div class="page-header">
<?php if ($this->acl->isAdminUser()): ?>
<?php if ($this->userSession->isAdmin()): ?>
<ul>
<li><i class="fa fa-user fa-fw"></i><?= $this->a(t('All users'), 'user', 'index') ?></li>
<li><i class="fa fa-plus fa-fw"></i><?= $this->a(t('New user'), 'user', 'create') ?></li>

View File

@@ -5,7 +5,7 @@
<?= $this->a(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?>
</li>
<?php if ($this->acl->isAdminUser() || $this->acl->isCurrentUser($user['id'])): ?>
<?php if ($this->userSession->isAdmin() || $this->userSession->isCurrentUser($user['id'])): ?>
<li>
<?= $this->a(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?>
</li>
@@ -30,7 +30,7 @@
</li>
<?php endif ?>
<?php if ($this->acl->isAdminUser() && ! $this->acl->isCurrentUser($user['id'])): ?>
<?php if ($this->userSession->isAdmin() && ! $this->userSession->isCurrentUser($user['id'])): ?>
<li>
<?= $this->a(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
</li>