public function checkPermission()
	{
		if ($this->User->isAdmin)
		{
			return;
		}

		// Set the root IDs
		if (empty($this->User->news) || !\is_array($this->User->news))
		{
			$root = array(0);
		}
		else
		{
			$root = $this->User->news;
		}

		// Check the current action
		switch (Contao\Input::get('act'))
		{
			case '': // empty
			case 'paste':
			case 'create':
			case 'select':
				// Check access to the news item
				$this->checkAccessToElement(CURRENT_ID, $root, true);
				break;

			case 'editAll':
			case 'deleteAll':
			case 'overrideAll':
			case 'cutAll':
			case 'copyAll':
				// Check access to the parent element if a content element is moved
				if (Contao\Input::get('act') == 'cutAll' || Contao\Input::get('act') == 'copyAll')
				{
					$this->checkAccessToElement(Contao\Input::get('pid'), $root, (Contao\Input::get('mode') == 2));
				}

				$objCes = $this->Database->prepare("SELECT id FROM tl_content WHERE ptable='tl_news' AND pid=?")
										 ->execute(CURRENT_ID);

				/** @var Symfony\Component\HttpFoundation\Session\SessionInterface $objSession */
				$objSession = Contao\System::getContainer()->get('session');

				$session = $objSession->all();
				$session['CURRENT']['IDS'] = array_intersect((array) $session['CURRENT']['IDS'], $objCes->fetchEach('id'));
				$objSession->replace($session);
				break;

			case 'cut':
			case 'copy':
				// Check access to the parent element if a content element is moved
				$this->checkAccessToElement(Contao\Input::get('pid'), $root, (Contao\Input::get('mode') == 2));
				// no break;

			default:
				// Check access to the content element
				$this->checkAccessToElement(Contao\Input::get('id'), $root);
				break;
		}
	}
public function checkPermission()
	{
		if ($this->User->isAdmin)
		{
			return;
		}

		
		if (empty($this->User->news) || !\is_array($this->User->news))
		{
			$root = array(0);
		}
		else
		{
			$root = $this->User->news;
		}

		
		switch (Contao\Input::get('act'))
		{
			case '': 
			case 'paste':
			case 'create':
			case 'select':
				
				$this->checkAccessToElement(CURRENT_ID, $root, true);
				break;

			case 'editAll':
			case 'deleteAll':
			case 'overrideAll':
			case 'cutAll':
			case 'copyAll':
				
				if (Contao\Input::get('act') == 'cutAll' || Contao\Input::get('act') == 'copyAll')
				{
					$this->checkAccessToElement(Contao\Input::get('pid'), $root, (Contao\Input::get('mode') == 2));
				}

				$objCes = $this->Database->prepare("SELECT id FROM tl_content WHERE ptable='tl_news' AND pid=?")
										 ->execute(CURRENT_ID);

				
				$objSession = Contao\System::getContainer()->get('session');

				$session = $objSession->all();
				$session['CURRENT']['IDS'] = array_intersect((array) $session['CURRENT']['IDS'], $objCes->fetchEach('id'));
				$objSession->replace($session);
				break;

			case 'cut':
			case 'copy':
				
				$this->checkAccessToElement(Contao\Input::get('pid'), $root, (Contao\Input::get('mode') == 2));
				

			default:
				
				$this->checkAccessToElement(Contao\Input::get('id'), $root);
				break;
		}
	}
public function checkPermission ( ) { if ( $ this -> User -> isAdmin ) { return ; } // Set the root IDs if ( empty ( $ this -> User -> news ) || ! \ is_array ( $ this -> User -> news ) ) { $ root = array ( 0 ) ; } else { $ root = $ this -> User -> news ; } // Check the current action switch ( Contao \ Input :: get ( 'act' ) ) { case '' : // empty case 'paste' : case 'create' : case 'select' : // Check access to the news item $ this -> checkAccessToElement ( CURRENT_ID , $ root , true ) ; break ; case 'editAll' : case 'deleteAll' : case 'overrideAll' : case 'cutAll' : case 'copyAll' : // Check access to the parent element if a content element is moved if ( Contao \ Input :: get ( 'act' ) == 'cutAll' || Contao \ Input :: get ( 'act' ) == 'copyAll' ) { $ this -> checkAccessToElement ( Contao \ Input :: get ( 'pid' ) , $ root , ( Contao \ Input :: get ( 'mode' ) == 2 ) ) ; } $ objCes = $ this -> Database -> prepare ( "SELECT id FROM tl_content WHERE ptable='tl_news' AND pid=?" ) -> execute ( CURRENT_ID ) ; /** @var Symfony\Component\HttpFoundation\Session\SessionInterface $objSession */ $ objSession = Contao \ System :: getContainer ( ) -> get ( 'session' ) ; $ session = $ objSession -> all ( ) ; $ session [ 'CURRENT' ] [ 'IDS' ] = array_intersect ( ( array ) $ session [ 'CURRENT' ] [ 'IDS' ] , $ objCes -> fetchEach ( 'id' ) ) ; $ objSession -> replace ( $ session ) ; break ; case 'cut' : case 'copy' : // Check access to the parent element if a content element is moved $ this -> checkAccessToElement ( Contao \ Input :: get ( 'pid' ) , $ root , ( Contao \ Input :: get ( 'mode' ) == 2 ) ) ; // no break; default : // Check access to the content element $ this -> checkAccessToElement ( Contao \ Input :: get ( 'id' ) , $ root ) ; break ; } }
Check permissions to edit table tl_content
Check permissions to edit table tl_content