From c33940f64a1e5b59afd700010247382f5b7b2df3 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 12 Nov 2018 14:41:23 +0100 Subject: Moved permission checks to Authenticator class --- includes/view/Shifts_view.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'includes/view/Shifts_view.php') diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 4c329f1b..4daaec8e 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -102,12 +102,10 @@ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null) */ function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupState $shift_signup_state) { - global $privileges; - - $shift_admin = in_array('admin_shifts', $privileges); - $user_shift_admin = in_array('user_shifts_admin', $privileges); - $admin_rooms = in_array('admin_rooms', $privileges); - $admin_shifttypes = in_array('shifttypes', $privileges); + $shift_admin = auth()->can('admin_shifts'); + $user_shift_admin = auth()->can('user_shifts_admin'); + $admin_rooms = auth()->can('admin_rooms'); + $admin_shifttypes = auth()->can('shifttypes'); $parsedown = new Parsedown(); -- cgit v1.3.1