mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 10:56:08 +01:00
allow checking of multiple permissions at once
This commit is contained in:
@@ -165,7 +165,14 @@ class Admin
|
|||||||
*/
|
*/
|
||||||
public function authorise($action = 'admin.login')
|
public function authorise($action = 'admin.login')
|
||||||
{
|
{
|
||||||
return $this->user->authorise($action);
|
$action = (array) $action;
|
||||||
|
|
||||||
|
foreach ($action as $a) {
|
||||||
|
if ($this->user->authorise($a))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user