mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-25 03:14:39 +03:00
[PR #1406] [MERGED] Permission check fixes #1375
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pelican-dev/panel/pull/1406
Author: @Boy132
Created: 5/26/2025
Status: ✅ Merged
Merged: 5/27/2025
Merged by: @Boy132
Base:
main← Head:boy132/fix-permission-checks📝 Commits (3)
0e0f197switch from "permission checks" to "policy checks"0511475add missing permissions checks to create options on CreateServere2745ddfix accessibleServers query when havingviewList serverpermissions📊 Changes
13 files changed (+36 additions, -32 deletions)
View changed files
📝
app/Filament/Admin/Resources/ApiKeyResource.php(+1 -1)📝
app/Filament/Admin/Resources/DatabaseHostResource/RelationManagers/DatabasesRelationManager.php(+2 -2)📝
app/Filament/Admin/Resources/NodeResource/RelationManagers/AllocationsRelationManager.php(+1 -1)📝
app/Filament/Admin/Resources/ServerResource.php(+1 -3)📝
app/Filament/Admin/Resources/ServerResource/Pages/CreateServer.php(+2 -0)📝
app/Filament/Admin/Resources/ServerResource/Pages/EditServer.php(+5 -5)📝
app/Filament/Admin/Resources/ServerResource/Pages/ListServers.php(+2 -2)📝
app/Filament/Components/Forms/Actions/RotateDatabasePasswordAction.php(+1 -1)📝
app/Filament/Server/Resources/ActivityResource.php(+2 -2)📝
app/Http/Requests/Api/Client/Servers/Subusers/SubuserRequest.php(+1 -1)📝
app/Models/User.php(+11 -7)📝
app/Policies/ServerPolicy.php(+5 -5)📝
app/Services/Servers/GetUserPermissionsService.php(+2 -2)📄 Description
Switches from checking permissions directly (e.g.
can('create server')orcan('update server', $server)) to using the policies (e.g.can('create', Server::class)orcan('update', $server)). This makes sure ourbeforelogic runs correctly.Adds missing checks to the create options on
CreateServer. (closes #1403)Fixes
accessibleServersquery to make sure the correct servers are displayed in the client area. (closes #1402)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.