PluginProbe
ShiftController Employee Shift Scheduling / trunk
ShiftController Employee Shift Scheduling vtrunk
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / conflicts / acl.php

acl.php in ShiftController Employee Shift Scheduling trunk, at sh4/conflicts/acl.php

40 lines 873 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 interface SH4_Conflicts_IAcl
3 {
4 public function checkView( $shiftId );
5 }
6
7 class SH4_Conflicts_Acl implements SH4_Conflicts_IAcl
8 {
9 public $self, $auth, $shiftsQuery;
10
11 public function __construct(
12 HC3_Hooks $hooks,
13 SH4_Shifts_Query $shiftsQuery,
14 HC3_Auth $auth
15 )
16 {
17 $this->self = $hooks->wrap( $this );
18 $this->auth = $hooks->wrap( $auth );
19 $this->shiftsQuery = $hooks->wrap( $shiftsQuery );
20 }
21
22 public function checkView( $shiftId )
23 {
24 $return = FALSE;
25
26 $shift = $this->shiftsQuery->findById( $shiftId );
27 if( ! ($shift && $shift->getId()) ){
28 return $return;
29 }
30
31 $currentUser = $this->auth->getCurrentUser();
32 $currentUserId = $currentUser->getId();
33 if( ! $currentUserId ){
34 return $return;
35 }
36
37 $return = TRUE;
38 return $return;
39 }
40 }