Skip to content
Snippets Groups Projects
Commit eae2953d authored by Elmar Ludwig's avatar Elmar Ludwig Committed by David Siegfried
Browse files

remove some unneeded code, re #1339

Merge request studip/studip!867
parent c3a47157
No related branches found
No related tags found
No related merge requests found
...@@ -37,33 +37,22 @@ class RoomManagement_OverviewController extends AuthenticatedController ...@@ -37,33 +37,22 @@ class RoomManagement_OverviewController extends AuthenticatedController
} }
parent::before_filter($action, $args); parent::before_filter($action, $args);
$this->user = User::findCurrent(); $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 = (
$this->show_resource_actions = ( ResourceManager::userHasGlobalPermission($this->user, 'autor')
ResourceManager::userHasGlobalPermission($this->user, 'autor') ||
|| ResourceManager::userHasResourcePermissions($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() public function index_action()
......
...@@ -153,17 +153,7 @@ ...@@ -153,17 +153,7 @@
|| $show_tutor_actions || $show_admin_actions || $show_tutor_actions || $show_admin_actions
|| $show_global_admin_actions || $additional_actions): ?> || $show_global_admin_actions || $additional_actions): ?>
<td class="actions"> <td class="actions">
<?= $this->render_partial('resources/_common/_action_menu.php', <?= $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'
)
);?>
</td> </td>
<? endif ?> <? endif ?>
</tr> </tr>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment