# shiftcontroller/4.9.66/sh4/conflicts/acl.php

ShiftController Employee Shift Scheduling, version 4.9.66. 40 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/sh4/conflicts/acl.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/raw/sh4/conflicts/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.66/code/sh4/conflicts/acl.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
interface SH4_Conflicts_IAcl
{
	public function checkView( $shiftId );
}

class SH4_Conflicts_Acl implements SH4_Conflicts_IAcl
{
	public $self, $auth, $shiftsQuery;

	public function __construct(
		HC3_Hooks $hooks,
		SH4_Shifts_Query $shiftsQuery,
		HC3_Auth $auth
		)
	{
		$this->self = $hooks->wrap( $this );
		$this->auth = $hooks->wrap( $auth );
		$this->shiftsQuery = $hooks->wrap( $shiftsQuery );
	}

	public function checkView( $shiftId )
	{
		$return = FALSE;

		$shift = $this->shiftsQuery->findById( $shiftId );
		if( ! ($shift && $shift->getId()) ){
			return $return;
		}

		$currentUser = $this->auth->getCurrentUser();
		$currentUserId = $currentUser->getId();
		if( ! $currentUserId ){
			return $return;
		}

		$return = TRUE;
		return $return;
	}
}
```
