Upgrade to 3.2.2

This commit is contained in:
Bastian Allgeier
2019-07-10 16:19:10 +02:00
parent 2744985432
commit 40f095f5de
3 changed files with 35 additions and 24 deletions

View File

@@ -105,7 +105,10 @@ class UserRules
// only admins are allowed to add admins
$role = $props['role'] ?? null;
if ($role === 'admin' && $user->kirby()->user()->isAdmin() === false) {
// get the current user if it exists
$currentUser = $user->kirby()->user();
if ($role === 'admin' && $currentUser && $currentUser->isAdmin() === false) {
throw new PermissionException([
'key' => 'user.create.permission'
]);