mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 00:06:37 +02:00
Admin check
This commit is contained in:
@@ -23,6 +23,8 @@ class Plugin implements EventSubscriberInterface
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
protected $active = true;
|
||||
|
||||
/**
|
||||
* By default assign all methods as listeners using the default priority.
|
||||
*
|
||||
@@ -53,6 +55,14 @@ class Plugin implements EventSubscriberInterface
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function isAdmin()
|
||||
{
|
||||
if (isset($this->grav['admin'])) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $events
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user