/** * Check if admin is logged in * If not, forward to tools overview * * @return void */ protected function checkAdminPermissions() { if (!BackendUtility::isBackendAdmin()) { $this->controllerContext = $this->buildControllerContext(); $this->forward('toolsBe'); } }
/** * Is Backend Admin? * * @return bool */ public function render() { return BackendUtility::isBackendAdmin(); }
/** * isBackendAdmin Test * * @param string $value * @param bool $expectedResult * @dataProvider isBackendAdminReturnsBoolDataProvider * @return void * @test */ public function isBackendAdminReturnsBool($value, $expectedResult) { $GLOBALS['BE_USER']->user['admin'] = $value; $this->assertSame($expectedResult, BackendUtility::isBackendAdmin()); }