New permission

- tagger: a user that can create / edit / delete the list of tags that is usable for events
pull/217/head
iglocska 2014-01-21 16:59:21 +01:00
parent a9d945ff19
commit 3f65618845
4 changed files with 36 additions and 5 deletions

View File

@ -121,6 +121,7 @@ class AppController extends Controller {
$this->set('isAclAudit', $role['perm_audit']);
$this->set('isAclAuth', $role['perm_auth']);
$this->set('isAclRegexp', $role['perm_regexp_access']);
$this->set('isAclTagger', $role['perm_tagger']);
$this->userRole = $role;
} else {
$this->set('me', false);
@ -135,6 +136,7 @@ class AppController extends Controller {
$this->set('isAclAudit', false);
$this->set('isAclAuth', false);
$this->set('isAclRegexp', false);
$this->set('isAclTagger', false);
}
if (Configure::read('debug') > 0) {
$this->debugMode = 'debugOn';

View File

@ -13,6 +13,7 @@
<?php echo $this->Form->input('perm_auth', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_site_admin', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_regexp_access', array('type' => 'checkbox', 'checked' => false));?>
<?php echo $this->Form->input('perm_tagger', array('type' => 'checkbox', 'checked' => false));?>
</fieldset>
<?php
echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
@ -30,6 +31,7 @@ $this->Js->get('#RolePermAdmin')->event('change', 'checkPerms("RolePermAdmin")')
$this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")');
$this->Js->get('#RolePermSiteAdmin')->event('change', 'checkPerms("RolePermSiteAdmin");activateAll();');
$this->Js->get('#RolePermRegexpAccess')->event('change', 'checkPerms("RolePermRegexpAccess")');
$this->Js->get('#RolePermTagger')->event('change', 'checkPerms("RolePermTagger")');
?>
<script type="text/javascript">
@ -43,6 +45,7 @@ function deactivateActions() {
document.getElementById("RolePermAudit").checked = false;
document.getElementById("RolePermSiteAdmin").checked = false;
document.getElementById("RolePermRegexpAccess").checked = false;
document.getElementById("RolePermRegexpTagger").checked = false;
}
}
@ -53,6 +56,7 @@ function activateAll() {
document.getElementById("RolePermAudit").checked = true;
document.getElementById("RolePermAuth").checked = true;
document.getElementById("RolePermRegexpAccess").checked = true;
document.getElementById("RolePermTagger").checked = true;
}
}

View File

@ -7,12 +7,18 @@
<?php echo $this->Form->input('permission', array('label' => 'Permissions', 'type' => 'select', 'options' => $options), array('value' => '3'));?>
<div class = 'input clear'></div>
<?php echo $this->Form->input('perm_sync', array('type' => 'checkbox', 'label' => 'Sync Actions', 'style' => 'vertical-align: middle'));?>
<?php echo $this->Form->input('perm_admin', array('type' => 'checkbox', 'label' => 'Administration Actions', 'style' => 'vertical-align: middle'));?>
<?php echo $this->Form->input('perm_audit', array('type' => 'checkbox', 'label' => 'Audit Actions', 'style' => 'vertical-align: middle'));?>
<?php echo $this->Form->input('perm_auth', array('type' => 'checkbox', 'label' => 'Auth Key Access', 'style' => 'vertical-align: middle'));?>
<?php echo $this->Form->input('perm_sync', array('type' => 'checkbox'));?>
<?php echo $this->Form->input('perm_admin', array('type' => 'checkbox'));?>
<?php echo $this->Form->input('perm_audit', array('type' => 'checkbox'));?>
<?php echo $this->Form->input('perm_auth', array('type' => 'checkbox'));?>
<?php echo $this->Form->input('perm_site_admin', array('type' => 'checkbox'));?>
<?php echo $this->Form->input('perm_regexp_access', array('type' => 'checkbox'));?>
<?php echo $this->Form->input('perm_tagger', array('type' => 'checkbox'));?>
</fieldset>
<?php echo $this->Form->end(__('Submit'));?>
<?php
echo $this->Form->button('Edit', array('class' => 'btn btn-primary'));
echo $this->Form->end();
?>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'editRole'));
@ -22,6 +28,9 @@
$this->Js->get('#RolePermSync')->event('change', 'checkPerms("RolePermSync")');
$this->Js->get('#RolePermAdmin')->event('change', 'checkPerms("RolePermAdmin")');
$this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")');
$this->Js->get('#RolePermSiteAdmin')->event('change', 'checkPerms("RolePermSiteAdmin");activateAll();');
$this->Js->get('#RolePermRegexpAccess')->event('change', 'checkPerms("RolePermRegexpAccess")');
$this->Js->get('#RolePermTagger')->event('change', 'checkPerms("RolePermTagger")');
?>
<script type="text/javascript">
@ -33,6 +42,20 @@ function deactivateActions() {
document.getElementById("RolePermSync").checked = false;
document.getElementById("RolePermAdmin").checked = false;
document.getElementById("RolePermAudit").checked = false;
document.getElementById("RolePermSiteAdmin").checked = false;
document.getElementById("RolePermRegexpAccess").checked = false;
document.getElementById("RolePermRegexpTagger").checked = false;
}
}
function activateAll() {
if (document.getElementById("RolePermSiteAdmin").checked) {
document.getElementById("RolePermSync").checked = true;
document.getElementById("RolePermAdmin").checked = true;
document.getElementById("RolePermAudit").checked = true;
document.getElementById("RolePermAuth").checked = true;
document.getElementById("RolePermRegexpAccess").checked = true;
document.getElementById("RolePermTagger").checked = true;
}
}

View File

@ -25,6 +25,7 @@
<th><?php echo $this->Paginator->sort('perm_audit', 'Audit Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_regexp', 'Regexp Actions');?></th>
<th><?php echo $this->Paginator->sort('perm_auth', 'Auth Key Access');?></th>
<th><?php echo $this->Paginator->sort('perm_tagger', 'Tag Editor');?></th>
<th><?php echo $this->Paginator->sort('perm_admin', 'Admin');?></th>
<th><?php echo $this->Paginator->sort('perm_site_admin', 'Site Admin');?></th>
<th class="actions"><?php echo __('Actions');?></th>
@ -38,6 +39,7 @@ foreach ($list as $item): ?>
<td class="short"><?php echo h($item['Role']['perm_audit']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_regexp_access']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_auth']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_tagger']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_admin']); ?>&nbsp;</td>
<td class="short"><?php echo h($item['Role']['perm_site_admin']); ?>&nbsp;</td>
<td class="short action-links">