Fix permission check if user is subuser and admin (#720)

This commit is contained in:
Boy132 2024-11-20 08:41:37 +01:00 committed by GitHub
parent 54039e25a4
commit 90afae79db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,8 +28,8 @@ class ServerPolicy
$subuser = $server->subusers->where('user_id', $user->id)->first(); $subuser = $server->subusers->where('user_id', $user->id)->first();
// If the user is a subuser check their permissions // If the user is a subuser check their permissions
if ($subuser) { if ($subuser && in_array($ability, $subuser->permissions)) {
return in_array($ability, $subuser->permissions); return true;
} }
// Return null to let default policies take over // Return null to let default policies take over