diff --git a/app/controllers/room_management/overview.php b/app/controllers/room_management/overview.php index aecf600664f31bddbe5c1850a7860a5edad9ca35..2b3022cb3f5374c5f1f4c468c448c4d0b23fcf7b 100644 --- a/app/controllers/room_management/overview.php +++ b/app/controllers/room_management/overview.php @@ -37,33 +37,22 @@ class RoomManagement_OverviewController extends AuthenticatedController } parent::before_filter($action, $args); $this->user = User::findCurrent(); + $this->user_is_root = $GLOBALS['perm']->have_perm('root'); + $this->user_is_global_resource_user = ResourceManager::userHasGlobalPermission($this->user); + $this->user_is_global_resource_admin = ResourceManager::userHasGlobalPermission($this->user, 'admin'); - if ($this->user) { - $this->show_resource_actions = ( - ResourceManager::userHasGlobalPermission($this->user, 'autor') - || - ResourceManager::userHasResourcePermissions($this->user, 'autor') - ); + $this->show_resource_actions = ( + ResourceManager::userHasGlobalPermission($this->user, 'autor') + || + ResourceManager::userHasResourcePermissions($this->user, 'autor') + ); + $this->show_admin_actions = ( + $this->user_is_global_resource_admin + || + ResourceManager::userHasResourcePermissions($this->user) + ); + $this->show_global_admin_actions = $this->user_is_global_resource_admin; - $this->show_admin_actions = ( - $this->user_is_global_resource_admin - || - ResourceManager::userHasResourcePermissions($this->user) - || - $GLOBALS['perm']->have_perm('root') - ); - $this->user_is_global_resource_user = ResourceManager::userHasGlobalPermission($this->user); - $this->user_is_root = $GLOBALS['perm']->have_perm('root'); - $this->user_is_global_resource_admin = ResourceManager::userHasGlobalPermission( - $this->user, - 'admin' - ) || $this->user_is_root; - $this->show_global_admin_actions = $this->user_is_global_resource_admin - && ResourceManager::userHasGlobalPermission( - $this->user, - 'admin' - ); - } } public function index_action() diff --git a/app/views/resources/_common/_resource_tr.php b/app/views/resources/_common/_resource_tr.php index 839e112061f481662b87598c34afe76b4ac41760..ccd7847a8f5a31c43ee7e0e8656203236f40b9d5 100644 --- a/app/views/resources/_common/_resource_tr.php +++ b/app/views/resources/_common/_resource_tr.php @@ -153,17 +153,7 @@ || $show_tutor_actions || $show_admin_actions || $show_global_admin_actions || $additional_actions): ?> <td class="actions"> - <?= $this->render_partial('resources/_common/_action_menu.php', - compact( - 'show_user_actions', - 'show_autor_actions', - 'show_autor_actions', - 'show_admin_actions', - 'show_global_admin_actions', - 'additional_actions', - 'resource' - ) - );?> + <?= $this->render_partial('resources/_common/_action_menu.php') ?> </td> <? endif ?> </tr>