[PR #1231] [MERGED] Allow to assign nodes to roles (node ownership) #1261

Closed
opened 2026-02-04 19:31:19 +03:00 by OVERLORD · 0 comments
Owner

📋 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: mainHead: boy132/node-ownership


📝 Commits (10+)

📊 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:
grafik
grafik

Manager A:
grafik

Manager B:
grafik

Admin: (Non root admin)
grafik

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.

## 📋 Pull Request Information **Original PR:** https://github.com/pelican-dev/panel/pull/1231 **Author:** [@Boy132](https://github.com/Boy132) **Created:** 4/10/2025 **Status:** ✅ Merged **Merged:** 5/5/2025 **Merged by:** [@Boy132](https://github.com/Boy132) **Base:** `main` ← **Head:** `boy132/node-ownership` --- ### 📝 Commits (10+) - [`6112586`](https://github.com/pelican-dev/panel/commit/6112586975bbea24ea5cd71640d466559ce67374) allow to assign nodes to roles - [`cd658e4`](https://github.com/pelican-dev/panel/commit/cd658e406b10fc3f58d6e714eed354a2dbc82636) fix typo - [`b8c9c40`](https://github.com/pelican-dev/panel/commit/b8c9c401414fe17a92fc460a7895c334a892badd) fix node policy - [`f9ca140`](https://github.com/pelican-dev/panel/commit/f9ca140647b3e229f499a6c558b87e50d00685da) small ui improvements - [`e9bb8c7`](https://github.com/pelican-dev/panel/commit/e9bb8c7ba4d49dca1217aec3b8bd760c7cbad02b) add missing translation - [`c8af658`](https://github.com/pelican-dev/panel/commit/c8af6587989d164e9bdfe4746a7ff8f3f3d3536b) make phpstan happy - [`a57a4b1`](https://github.com/pelican-dev/panel/commit/a57a4b1651ada5d1725e63a12b86e535d82bd11f) fix migration on mysql - [`97cf1e3`](https://github.com/pelican-dev/panel/commit/97cf1e31862aadd0ad79e6f3d9ed7bd343689cbb) also restrict mounts & database hosts to allowed nodes - [`d721af6`](https://github.com/pelican-dev/panel/commit/d721af6be10ab9169b8c36363c46df2a21b2b0ea) fix migration on mysql v2 - [`ef4aff7`](https://github.com/pelican-dev/panel/commit/ef4aff7b2d7f9b548c5e69112a2e9c60fbeea5e2) changes from review ### 📊 Changes **18 files changed** (+219 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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: ![grafik](https://github.com/user-attachments/assets/1e7817ce-4c95-48a9-953f-cab0357577e1) ![grafik](https://github.com/user-attachments/assets/d003c29a-4451-461e-ada3-94a044f88f6c) Manager A: ![grafik](https://github.com/user-attachments/assets/06e6f773-48fd-4c61-b3cd-61ff13ea1ac6) Manager B: ![grafik](https://github.com/user-attachments/assets/e7788ff8-1dc5-4a44-87ed-c6f629df13b0) Admin: (Non root admin) ![grafik](https://github.com/user-attachments/assets/696679ff-e278-4219-8bb8-96ae9a63e469) 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-04 19:31:19 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/panel#1261