summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-03-01 19:51:09 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-03-01 19:51:09 -0500
commit28bc4246bff405367c9e5640bca356b307962026 (patch)
tree897fa49d471c1f4c6fc00bbd7e6d427239d01bd3 /templates
parente7db71b593f2d9856a5b3aacde00a638d074d601 (diff)
Add acl and access list for projects
Diffstat (limited to 'templates')
-rw-r--r--templates/project_forbidden.php9
-rw-r--r--templates/project_index.php3
-rw-r--r--templates/project_users.php44
3 files changed, 56 insertions, 0 deletions
diff --git a/templates/project_forbidden.php b/templates/project_forbidden.php
new file mode 100644
index 00000000..1cba7b58
--- /dev/null
+++ b/templates/project_forbidden.php
@@ -0,0 +1,9 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Forbidden') ?></h2>
+ </div>
+
+ <p class="alert alert-error">
+ <?= t('You are not allowed to access to this project.') ?>
+ </p>
+</section> \ No newline at end of file
diff --git a/templates/project_index.php b/templates/project_index.php
index 4048879b..7d3e1844 100644
--- a/templates/project_index.php
+++ b/templates/project_index.php
@@ -63,6 +63,9 @@
<a href="?controller=project&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit project') ?></a>
</li>
<li>
+ <a href="?controller=project&amp;action=users&amp;project_id=<?= $project['id'] ?>"><?= t('Edit users access') ?></a>
+ </li>
+ <li>
<a href="?controller=board&amp;action=edit&amp;project_id=<?= $project['id'] ?>"><?= t('Edit board') ?></a>
</li>
<li>
diff --git a/templates/project_users.php b/templates/project_users.php
new file mode 100644
index 00000000..0448004f
--- /dev/null
+++ b/templates/project_users.php
@@ -0,0 +1,44 @@
+<section id="main">
+ <div class="page-header">
+ <h2><?= t('Project access list for "%s"', $project['name']) ?></h2>
+ <ul>
+ <li><a href="?controller=project"><?= t('All projects') ?></a></li>
+ </ul>
+ </div>
+ <section>
+
+ <?php if (! empty($users['not_allowed'])): ?>
+ <form method="post" action="?controller=project&amp;action=allow&amp;project_id=<?= $project['id'] ?>" autocomplete="off">
+
+ <?= Helper\form_hidden('project_id', array('project_id' => $project['id'])) ?>
+
+ <?= Helper\form_label(t('User'), 'user_id') ?>
+ <?= Helper\form_select('user_id', $users['not_allowed']) ?><br/>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Allow this user') ?>" class="btn btn-blue"/>
+ <?= t('or') ?> <a href="?controller=project"><?= t('cancel') ?></a>
+ </div>
+ </form>
+ <?php endif ?>
+
+ <h3><?= t('List of authorized users') ?></h3>
+ <?php if (empty($users['allowed'])): ?>
+ <div class="alert alert-info"><?= t('Everybody have access to this project.') ?></div>
+ <?php else: ?>
+ <div class="listing">
+ <p><?= t('Only those users have access to this project:') ?></p>
+ <ul>
+ <?php foreach ($users['allowed'] as $user_id => $username): ?>
+ <li>
+ <strong><?= Helper\escape($username) ?></strong>
+ (<a href="?controller=project&amp;action=revoke&amp;project_id=<?= $project['id'] ?>&amp;user_id=<?= $user_id ?>"><?= t('revoke') ?></a>)
+ </li>
+ <?php endforeach ?>
+ </ul>
+ <p><?= t('Don\'t forget that administrators have access to everything.') ?></p>
+ </div>
+ <?php endif ?>
+
+ </section>
+</section> \ No newline at end of file