Skip to content
Snippets Groups Projects
Commit 3d90b12c authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Admin Menu Item should not throw an exception

instead the visibility is properly checked in the visibleInContext()
method.
parent 4f32ee18
No related branches found
No related tags found
No related merge requests found
......@@ -11,14 +11,18 @@ class Admin extends AbstractItem {
/** @inheritdoc */
public function __construct() {
global $INFO;
parent::__construct();
$this->svg = DOKU_INC . 'lib/images/menu/settings.svg';
}
/** @inheritdoc */
public function visibleInContext($ctx)
{
global $INFO;
if(!$INFO['ismanager']) return false;
if(!$INFO['ismanager']) {
throw new \RuntimeException("admin is for managers only");
}
return parent::visibleInContext($ctx);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment