Skip to content

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Jun 29, 2025

This pull request introduces a new "owner" concept to the system, allowing for the designation of a specific administrative user as the owner of the installation. It adds support for managing ownership, including validation rules, configuration changes, and UI updates. Additionally, it enhances user management by introducing a may_administrate permission for more granular control over administrative rights.

Ownership Management

  • Added a new configuration key owner_id in the configs table to track the owner of the installation, along with a migration to initialize this value based on existing administrators (database/migrations/2025_06_29_080951_create_owner.php).
  • Introduced OwnerConfigRule to restrict changes to the owner_id configuration to the current owner only (app/Rules/OwnerConfigRule.php).
  • Added OwnerIdRule to enforce that only the owner can perform specific actions, such as deleting or modifying the owner account (app/Rules/OwnerIdRule.php).

Administrative Permissions

  • Introduced a new may_administrate permission for users, allowing fine-grained control over administrative capabilities in user creation and update workflows (app/Actions/User/Create.php, app/Actions/User/Save.php). [1] [2]
  • Updated user-related request classes (AddUserRequest, SetUserSettingsRequest) to handle the may_administrate attribute, including validation and processing (app/Http/Requests/UserManagement/AddUserRequest.php, app/Http/Requests/UserManagement/SetUserSettingsRequest.php). [1] [2]

Frontend Updates

  • Added a checkbox in the user creation/edit form to toggle the may_administrate permission, with a warning icon and special styling to indicate the significance of this permission (resources/js/components/forms/users/CreateEditUser.vue).

Additional Enhancements

  • Extended the UserManagementResource to include an is_owner field, which identifies if a user is the owner of the installation (app/Http/Resources/Models/UserManagementResource.php).
  • Updated the Configs model to validate the owner_id value against existing administrative users (app/Models/Configs.php).

@ildyria ildyria requested a review from a team as a code owner June 29, 2025 11:13
@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Jun 29, 2025
@ildyria ildyria force-pushed the owner-admin/translations branch from b8aefb0 to bbbd959 Compare June 29, 2025 11:24
@ildyria ildyria force-pushed the owner-admin/admin-management branch from 363e0d1 to 614cc48 Compare June 29, 2025 11:31
Copy link

codecov bot commented Jun 29, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.03%. Comparing base (bbbd959) to head (9eecd82).
Report is 1 commits behind head on owner-admin/translations.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria merged commit bde7a35 into owner-admin/translations Jun 30, 2025
33 checks passed
@ildyria ildyria deleted the owner-admin/admin-management branch June 30, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants