# shiftcontroller/4.9.85/sh4/schedule/acl.php

ShiftController Employee Shift Scheduling, version 4.9.85. 48 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/sh4/schedule/acl.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/raw/sh4/schedule/acl.php
- Modified: 2023-05-29T12:46:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/sh4/schedule/acl.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
interface SH4_Schedule_IAcl
{
	public function checkMy( $params = array() );
}

class SH4_Schedule_Acl implements SH4_Schedule_IAcl
{
	public $self, $appQuery, $auth;

	public function __construct(
		HC3_Hooks $hooks,

		SH4_App_Query $appQuery,
		HC3_Auth $auth
		)
	{
		$this->self = $hooks->wrap( $this );

		$this->appQuery = $hooks->wrap( $appQuery );
		$this->auth = $hooks->wrap( $auth );
	}

	public function checkMy( $params = array() )
	{
		$return = FALSE;

		$currentUser = $this->auth->getCurrentUser();
		$currentUserId = $currentUser->getId();
		if( ! $currentUserId ){
			return $return;
		}

		$currentUserId = $currentUser->getId();
		if( ! $currentUserId ){
			return $return;
		}

	// as employee
		$meEmployee = $this->appQuery->findEmployeeByUser( $currentUser );
		if( ! $meEmployee ){
			return $return;
		}

		$return = TRUE;
		return $return;
	}
}
```
