mirror of
https://github.com/pelican-dev/panel.git
synced 2026-02-24 19:08:53 +03:00
[PR #1231] [MERGED] Allow to assign nodes to roles (node ownership) #1261
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/1231
Author: @Boy132
Created: 4/10/2025
Status: ✅ Merged
Merged: 5/5/2025
Merged by: @Boy132
Base:
main← Head:boy132/node-ownership📝 Commits (10+)
6112586allow to assign nodes to rolescd658e4fix typob8c9c40fix node policyf9ca140small ui improvementse9bb8c7add missing translationc8af658make phpstan happya57a4b1fix migration on mysql97cf1e3also restrict mounts & database hosts to allowed nodesd721af6fix migration on mysql v2ef4aff7changes from review📊 Changes
18 files changed (+219 additions, -12 deletions)
View changed files
📝
app/Filament/Admin/Resources/DatabaseHostResource.php(+12 -2)📝
app/Filament/Admin/Resources/DatabaseHostResource/Pages/CreateDatabaseHost.php(+2 -1)📝
app/Filament/Admin/Resources/MountResource.php(+12 -2)📝
app/Filament/Admin/Resources/NodeResource.php(+9 -1)📝
app/Filament/Admin/Resources/RoleResource.php(+14 -0)📝
app/Filament/Admin/Resources/ServerResource.php(+11 -1)📝
app/Filament/Admin/Resources/ServerResource/Pages/CreateServer.php(+8 -2)📝
app/Filament/Admin/Resources/ServerResource/Pages/EditServer.php(+1 -1)📝
app/Models/Node.php(+7 -0)➕
app/Models/NodeRole.php(+12 -0)📝
app/Models/Role.php(+8 -0)📝
app/Models/User.php(+29 -2)📝
app/Policies/DatabaseHostPolicy.php(+19 -0)📝
app/Policies/MountPolicy.php(+19 -0)📝
app/Policies/NodePolicy.php(+17 -0)📝
app/Policies/ServerPolicy.php(+5 -0)➕
database/migrations/2025_04_08_113556_create_node_role_table.php(+32 -0)📝
lang/en/admin/role.php(+2 -0)📄 Description
Closes #613
Allows to assign certain nodes to roles. If a user has a role that only has node A assigned they can only manage node A and servers on node A. (still needs the according permissions like create, update etc.) Also applies to mounts and database hosts.
Example:


Manager A:

Manager B:

Admin: (Non root admin)

Note: the assigned role nodes also do "stack". Meaning if you give a user both the manager A and the manager B roles they will get access to both nodes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.