mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 11:16:12 +02:00
Prevent expert editing mode from anyone else than super users [#2094]
This commit is contained in:
@@ -512,10 +512,10 @@ class AdminPlugin extends Plugin
|
||||
$this->session = $this->grav['session'];
|
||||
|
||||
// set session variable if it's passed via the url
|
||||
if ($this->uri->param('mode') === 'expert') {
|
||||
$this->session->expert = true;
|
||||
} elseif ($this->uri->param('mode') === 'normal') {
|
||||
if (!$this->session->user->authorize('admin.super') || $this->uri->param('mode') === 'normal') {
|
||||
$this->session->expert = false;
|
||||
} elseif ($this->uri->param('mode') === 'expert') {
|
||||
$this->session->expert = true;
|
||||
} else {
|
||||
// set the default if not set before
|
||||
$this->session->expert = $this->session->expert ?? false;
|
||||
|
||||
Reference in New Issue
Block a user