mirror of
https://github.com/btouchard/ackify.git
synced 2026-04-27 02:31:13 -05:00
feat(admin): add option to restrict document creation to admins only
Add new configuration option ACKIFY_ONLY_ADMIN_CAN_CREATE (default: false) to control who can create documents. Backend changes: - Add OnlyAdminCanCreate config field to AppConfig - Implement authorization checks in document handlers - Protect POST /documents and GET /documents/find-or-create endpoints - Add unit tests for admin-only document creation (4 tests) Frontend changes: - Inject ACKIFY_ONLY_ADMIN_CAN_CREATE to window object - Hide DocumentForm component for non-admin users when enabled - Add i18n translations (en, fr, es, de, it) - Display warning message for non-admin users Documentation: - Update .env.example files with new variable - Update configuration docs (en/fr) - Update install script to prompt for restriction option - Update install/README.md When enabled, only users listed in ACKIFY_ADMIN_EMAILS can create new documents. Both direct creation and find-or-create endpoints are protected.
This commit is contained in:
@@ -65,5 +65,8 @@ ACKIFY_ED25519_PRIVATE_KEY=your_base64_encoded_ed25519_private_key
|
||||
# Admin Configuration
|
||||
# ACKIFY_ADMIN_EMAILS=admin@your-domain.com,admin2@your-domain.com
|
||||
|
||||
# Document Creation Restriction
|
||||
# ACKIFY_ONLY_ADMIN_CAN_CREATE=false
|
||||
|
||||
# Server Configuration
|
||||
ACKIFY_LISTEN_ADDR=:8080
|
||||
Reference in New Issue
Block a user