summaryrefslogtreecommitdiff
path: root/includes/view/User_view.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-12 14:41:23 +0100
committermsquare <msquare@notrademark.de>2018-12-02 12:53:31 +0100
commitc33940f64a1e5b59afd700010247382f5b7b2df3 (patch)
tree453b8810c90cd78e75a1425a4f4f002e585d121a /includes/view/User_view.php
parent951828a4f1175f99666a48629ea125640cc7c598 (diff)
Moved permission checks to Authenticator class
Diffstat (limited to 'includes/view/User_view.php')
-rw-r--r--includes/view/User_view.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 2b4154b4..275a31ca 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -352,8 +352,6 @@ function User_view_shiftentries($needed_angel_type)
*/
function User_view_myshift($shift, $user_source, $its_me)
{
- global $privileges;
-
$shift_info = '<a href="' . shift_link($shift) . '">' . $shift['name'] . '</a>';
if ($shift['title']) {
$shift_info .= '<br /><a href="' . shift_link($shift) . '">' . $shift['title'] . '</a>';
@@ -382,7 +380,7 @@ function User_view_myshift($shift, $user_source, $its_me)
$myshift['duration'] = '<p class="text-danger">'
. round(-($shift['end'] - $shift['start']) / 3600 * 2, 2) . '&nbsp;h'
. '</p>';
- if (in_array('user_shifts_admin', $privileges)) {
+ if (auth()->can('user_shifts_admin')) {
$myshift['comment'] .= '<br />'
. '<p class="text-danger">' . __('Freeloaded') . ': ' . $shift['freeload_comment'] . '</p>';
} else {
@@ -393,7 +391,7 @@ function User_view_myshift($shift, $user_source, $its_me)
$myshift['actions'] = [
button(shift_link($shift), glyph('eye-open') . __('view'), 'btn-xs')
];
- if ($its_me || in_array('user_shifts_admin', $privileges)) {
+ if ($its_me || auth()->can('user_shifts_admin')) {
$myshift['actions'][] = button(
page_link_to('user_myshifts', ['edit' => $shift['id'], 'id' => $user_source->id]),
glyph('edit') . __('edit'),