fix: [orggroups:ui] Aligned UI with what users can actually do
parent
b987444da2
commit
1a7320e363
|
@ -8,7 +8,7 @@ class OrgGroupsNavigation extends BaseNavigation
|
||||||
public function addLinks()
|
public function addLinks()
|
||||||
{
|
{
|
||||||
$controller = 'OrgGroups';
|
$controller = 'OrgGroups';
|
||||||
if (empty($this->viewVars['canEdit'])) {
|
if (empty($this->viewVars['canEditDefinition'])) {
|
||||||
$this->bcf->removeLink($controller, 'view', $controller, 'edit');
|
$this->bcf->removeLink($controller, 'view', $controller, 'edit');
|
||||||
$this->bcf->removeLink($controller, 'edit', $controller, 'edit');
|
$this->bcf->removeLink($controller, 'edit', $controller, 'edit');
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,10 @@ class OrgGroupsNavigation extends BaseNavigation
|
||||||
public function addActions()
|
public function addActions()
|
||||||
{
|
{
|
||||||
$controller = 'OrgGroups';
|
$controller = 'OrgGroups';
|
||||||
if (empty($this->viewVars['canEdit'])) {
|
if (empty($this->viewVars['canEditDefinition'])) {
|
||||||
$this->bcf->removeAction($controller, 'view', $controller, 'delete');
|
$this->bcf->removeAction($controller, 'view', $controller, 'delete');
|
||||||
$this->bcf->removeAction($controller, 'edit', $controller, 'delete');
|
$this->bcf->removeAction($controller, 'edit', $controller, 'delete');
|
||||||
|
$this->bcf->removeAction($controller, 'view', $controller, 'add');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ class OrgGroupsController extends AppController
|
||||||
return $responsePayload;
|
return $responsePayload;
|
||||||
}
|
}
|
||||||
$this->set('canEdit', $this->canEdit($id));
|
$this->set('canEdit', $this->canEdit($id));
|
||||||
|
$this->set('canEditDefinition', $this->canEditDefinition($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
|
@ -136,6 +137,15 @@ class OrgGroupsController extends AppController
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function canEditDefinition($groupId): bool
|
||||||
|
{
|
||||||
|
$currentUser = $this->ACL->getUser();
|
||||||
|
if ($currentUser['role']['perm_admin']) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Listing should be available to all, it's purely informational
|
// Listing should be available to all, it's purely informational
|
||||||
public function listAdmins($groupId)
|
public function listAdmins($groupId)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue