Rewrite of the authentication and authorization system

This commit is contained in:
Frederic Guillot
2015-12-05 20:31:27 -05:00
parent 346b8312e5
commit e9fedf3e5c
255 changed files with 14114 additions and 9820 deletions

View File

@@ -1,12 +1,14 @@
<section id="main">
<div class="page-header">
<ul>
<?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?>
<?php if ($this->user->hasAccess('project', 'create')): ?>
<li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New project'), 'project', 'create') ?></li>
<?php endif ?>
<li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'create', array('private' => 1)) ?></li>
<?php if ($this->user->isProjectAdmin() || $this->user->isAdmin()): ?>
<li><i class="fa fa-lock fa-fw"></i><?= $this->url->link(t('New private project'), 'project', 'createPrivate') ?></li>
<?php if ($this->user->hasAccess('projectuser', 'managers')): ?>
<li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li>
<?php endif ?>
<?php if ($this->user->hasAccess('gantt', 'projects')): ?>
<li><i class="fa fa-sliders fa-fw"></i><?= $this->url->link(t('Projects Gantt chart'), 'gantt', 'projects') ?></li>
<?php endif ?>
</ul>
@@ -21,7 +23,7 @@
<th class="column-15"><?= $paginator->order(t('Project'), 'name') ?></th>
<th class="column-8"><?= $paginator->order(t('Start date'), 'start_date') ?></th>
<th class="column-8"><?= $paginator->order(t('End date'), 'end_date') ?></th>
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
<?php if ($this->user->hasAccess('projectuser', 'managers')): ?>
<th class="column-12"><?= t('Managers') ?></th>
<th class="column-12"><?= t('Members') ?></th>
<?php endif ?>
@@ -64,25 +66,17 @@
<td>
<?= $project['end_date'] ?>
</td>
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
<td>
<ul class="no-bullet">
<?php foreach ($project['managers'] as $user_id => $user_name): ?>
<li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li>
<?php endforeach ?>
</ul>
</td>
<td>
<?php if ($project['is_everybody_allowed'] == 1): ?>
<?= t('Everybody') ?>
<?php else: ?>
<ul class="no-bullet">
<?php foreach ($project['members'] as $user_id => $user_name): ?>
<li><?= $this->url->link($this->e($user_name), 'projectuser', 'opens', array('user_id' => $user_id)) ?></li>
<?php endforeach ?>
</ul>
<?php endif ?>
</td>
<?php if ($this->user->hasAccess('projectuser', 'managers')): ?>
<td>
<?= $this->render('project/roles', array('roles' => $project, 'role' => \Kanboard\Core\Security\Role::PROJECT_MANAGER)) ?>
</td>
<td>
<?php if ($project['is_everybody_allowed'] == 1): ?>
<?= t('Everybody') ?>
<?php else: ?>
<?= $this->render('project/roles', array('roles' => $project, 'role' => \Kanboard\Core\Security\Role::PROJECT_MEMBER)) ?>
<?php endif ?>
</td>
<?php endif ?>
<td class="dashboard-project-stats">
<?php foreach ($project['columns'] as $column): ?>