Skip to content

feat(auth): restrict admin access and add administrator provisioning - #20

Merged
replworks-bot merged 1 commit into
mainfrom
feat/admin-provisioning
Oct 26, 2026
Merged

replworks-bot merged 1 commit into
mainfrom
feat/admin-provisioning

Conversation

@replworks-bot

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the admin panel being available to every user by adding users.is_admin (default false) and checking it in canAccessPanel().
  • Non-administrator users can no longer log in to or access the Filament admin panel.
  • The local admin seeder grants the flag to cable8mm@gmail.com; the seeded general user stays non-admin.
  • Adds php artisan filmo:create-admin {email} to create a new administrator or promote an existing user.
  • Supports interactive name/password prompts, optional --name/--password for automation, and validates email and an 8-character minimum password.
  • Updates PRODUCT_SPEC.md, ARCHITECTURE.md, and TASKS.md through T-021.

Usage

# Interactive
php artisan filmo:create-admin admin@example.com

# Create a new administrator non-interactively
php artisan filmo:create-admin admin@example.com --name="Admin" --password="secret123"

# Promote an existing user without changing their name or password
php artisan filmo:create-admin existing@example.com

Test plan

  • php artisan test --compact (100 passed, 2 skipped live tests)
  • XDEBUG_MODE=coverage composer test:coverage (94.22% line coverage)
  • vendor/bin/pint --format agent
  • npm run build
  • Covers admin access, non-admin login/access denial, seeder flags, and command create/promote/validation.

- Add the users.is_admin flag, defaulting to false
- Allow only administrators to authenticate to and access the Filament panel
- Update the local admin seeder and keep the seeded general user non-admin
- Add `filmo:create-admin` to create an administrator or promote an existing User
- Validate the administrator email, name, and password, with interactive prompts
- Update PRODUCT_SPEC.md, ARCHITECTURE.md, and TASKS.md through T-021

Co-authored-by: Samgu Lee <cable8mm@gmail.com>
@replworks-bot replworks-bot self-assigned this Oct 26, 2026
@replworks-bot
replworks-bot merged commit 2386d3f into main Oct 26, 2026
1 check passed
@replworks-bot
replworks-bot deleted the feat/admin-provisioning branch October 26, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant