Simplified the organisation column permissions for now

This commit is contained in:
2023-07-18 13:29:34 +01:00
parent 85b1cec060
commit 0f5140d01f

View File

@@ -1114,17 +1114,8 @@ class OrganisationController extends SimpleController
throw new ForbiddenException(); throw new ForbiddenException();
} }
$tableColumns = [ 'description' ]; $tableColumns = [ 'description', 'join' ];
if (
(
$currentUser->organisations(true)->count() == 0
|| !$config['organisation']['membership']['single_membership']
)
&& !$config['organisation']['combine_action_buttons']
) {
$tableColumns[] = 'join';
}
if ($currentUser->organisations(true)->wherePivot('flag_admin', true) if ($currentUser->organisations(true)->wherePivot('flag_admin', true)
|| $authorizer->checkAccess($currentUser, 'delete_organisation') || $authorizer->checkAccess($currentUser, 'delete_organisation')
@@ -1136,6 +1127,11 @@ class OrganisationController extends SimpleController
$tableColumns[] = 'actions'; $tableColumns[] = 'actions';
} }
if ($currentUser->organisations(true)->wherePivot('flag_admin', true)) {
$tableColumns[] = 'status';
$tableColumns[] = 'actions';
}
return $this->ci->view->render( return $this->ci->view->render(
$response, $response,
'pages/organisations.html.twig', 'pages/organisations.html.twig',