chg: [ui] Improved reflection of ACL logic in the UI for OrgGroups, Organisations and individuals.
parent
4d58b94d58
commit
d2cb072ce6
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
namespace BreadcrumbNavigation;
|
||||
|
||||
require_once(APP . 'Controller' . DS . 'Component' . DS . 'Navigation' . DS . 'base.php');
|
||||
|
||||
class OrgGroupsNavigation extends BaseNavigation
|
||||
{
|
||||
public function addLinks()
|
||||
{
|
||||
$controller = 'OrgGroups';
|
||||
if (empty($this->viewVars['canEdit'])) {
|
||||
$this->bcf->removeLink($controller, 'view', $controller, 'edit');
|
||||
$this->bcf->removeLink($controller, 'edit', $controller, 'edit');
|
||||
}
|
||||
}
|
||||
|
||||
public function addActions()
|
||||
{
|
||||
$controller = 'OrgGroups';
|
||||
if (empty($this->viewVars['canEdit'])) {
|
||||
$this->bcf->removeAction($controller, 'view', $controller, 'delete');
|
||||
$this->bcf->removeAction($controller, 'edit', $controller, 'delete');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,4 +5,21 @@ require_once(APP . 'Controller' . DS . 'Component' . DS . 'Navigation' . DS . 'b
|
|||
|
||||
class OrganisationsNavigation extends BaseNavigation
|
||||
{
|
||||
public function addLinks()
|
||||
{
|
||||
$controller = 'Organisations';
|
||||
if (empty($this->viewVars['canEdit'])) {
|
||||
$this->bcf->removeLink($controller, 'view', $controller, 'edit');
|
||||
$this->bcf->removeLink($controller, 'edit', $controller, 'edit');
|
||||
}
|
||||
}
|
||||
|
||||
public function addActions()
|
||||
{
|
||||
$controller = 'Organisations';
|
||||
if (empty($this->viewVars['canEdit'])) {
|
||||
$this->bcf->removeAction($controller, 'view', $controller, 'delete');
|
||||
$this->bcf->removeAction($controller, 'edit', $controller, 'delete');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,6 +156,7 @@ class NavigationComponent extends Component
|
|||
$CRUDControllers = [
|
||||
'Individuals',
|
||||
'Organisations',
|
||||
'OrgGroups',
|
||||
'EncryptionKeys',
|
||||
'SharingGroups',
|
||||
'Broods',
|
||||
|
|
|
@ -39,7 +39,7 @@ class IndividualsController extends AppController
|
|||
if (!empty($responsePayload)) {
|
||||
return $responsePayload;
|
||||
}
|
||||
$editableIds = null;
|
||||
$editableIds = [];
|
||||
if ($orgAdmin) {
|
||||
$editableIds = $this->Individuals->getValidIndividualsToEdit($currentUser);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'type' => 'simple',
|
||||
'text' => __('Add group'),
|
||||
'class' => 'btn btn-primary',
|
||||
'popover_url' => '/orgGroups/add'
|
||||
'popover_url' => '/orgGroups/add',
|
||||
'requirement' => !empty($loggedUser['role']['perm_admin']),
|
||||
]
|
||||
]
|
||||
],
|
||||
|
|
|
@ -11,7 +11,8 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'type' => 'simple',
|
||||
'text' => __('Add organisation'),
|
||||
'class' => 'btn btn-primary',
|
||||
'popover_url' => '/organisations/add'
|
||||
'popover_url' => '/organisations/add',
|
||||
'requirement' => !empty($loggedUser['role']['perm_admin']),
|
||||
]
|
||||
]
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue