<?php

if (! defined('BASEPATH')) exit('No direct script access allowed');

use \DateTime as DateTime;

class NotizProjektphase extends Notiz_Controller
{
	public function __construct()
	{
		parent::__construct([
			'isBerechtigt' => ['admin:r', 'assistenz:r'],
		]);
	}

	public function isBerechtigt($id, $typeId)
	{
		if($typeId != "projektphase_id")
		{
			$this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL);
		}

		//TODO define permission
		if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid'))
		{
			$result =  $this->p->t('lehre','error_keineSchreibrechte');

			$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
		}
		$this->terminateWithSuccess("berechtigt in überschreibender Funktion");
	}
}