SEC-05E · Section 5: Mosque Registration and Management
✓ Fully Implemented
Managing Mosque Administrators, Workspace Staff & Tenant Isolation (/mosque-admin/members)
How to assign, update, or deactivate Mosque Administrators, Editors, and Workspace Members at /mosque-admin/members, including last-Mosque-Admin protection and multi-tenant isolation rules.
1. Assigning a User to the Mosque Workspace (/mosque-admin/members)
- Sign in as
mosque_adminand open/{lang}/mosque-admin/members. - In the assignment form:
- Enter the existing user’s Email address.
- Select the Mosque Role:
Mosque Admin(mosque_admin),Mosque Editor(mosque_editor), orMosque Member(mosque_member). - Select the Status (
activeorinactive).
- Click Save. The assignment is stored in
mosque_usersfor the activemosque_id.
2. Last Mosque Administrator Safeguard
The system prevents demoting or deactivating the last active mosque_admin for a mosque. Always assign and activate a replacement mosque_admin before removing or downgrading the existing administrator.
3. Multi-Tenant Independence & Data Boundaries
- Role grants in
mosque_usersapply exclusively to the specifiedmosque_id. - Each mosque tenant can access only its own profile, microsite, activities, kariah areas, kariah members, and billing records.
Input Fields & Options Reference
| Field | Allowed Values | Description |
|---|---|---|
email | Registered user email | Must match an existing account in the users table. |
role_id | mosque_admin, mosque_editor, mosque_member | Only scope = 'mosque' roles are accepted. |
status | active / inactive | Controls whether the assignment is active for this mosque. |
Expected Results: The user role assignment for the mosque is updated in `mosque_users` and logged in `audit_logs` (`mosque.user.assigned`).
Important Notes & Data Boundaries: Note the distinction: `/mosque-admin/members` manages administrative workspace users (`mosque_users`), whereas `/mosque-admin/kariah-members` manages community kariah membership (`kariah_members`).
Common Errors & Troubleshooting
If you see "Unable to assign that user and role", verify that the email exists in users and that at least one active mosque_admin remains assigned to the mosque.