PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
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 / schedule / acl.php

acl.php in ShiftController Employee Shift Scheduling 4.9.66, at sh4/schedule/acl.php

48 lines 987 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_Schedule_IAcl
3 {
4 public function checkMy( $params = array() );
5 }
6
7 class SH4_Schedule_Acl implements SH4_Schedule_IAcl
8 {
9 public $self, $appQuery, $auth;
10
11 public function __construct(
12 HC3_Hooks $hooks,
13
14 SH4_App_Query $appQuery,
15 HC3_Auth $auth
16 )
17 {
18 $this->self = $hooks->wrap( $this );
19
20 $this->appQuery = $hooks->wrap( $appQuery );
21 $this->auth = $hooks->wrap( $auth );
22 }
23
24 public function checkMy( $params = array() )
25 {
26 $return = FALSE;
27
28 $currentUser = $this->auth->getCurrentUser();
29 $currentUserId = $currentUser->getId();
30 if( ! $currentUserId ){
31 return $return;
32 }
33
34 $currentUserId = $currentUser->getId();
35 if( ! $currentUserId ){
36 return $return;
37 }
38
39 // as employee
40 $meEmployee = $this->appQuery->findEmployeeByUser( $currentUser );
41 if( ! $meEmployee ){
42 return $return;
43 }
44
45 $return = TRUE;
46 return $return;
47 }
48 }