Ministries & Departments

Ministry Membership & Department Roles

Contact roles and specialized service duties within departments are managed in the `ministry_members` table.

Ministry Membership & Department Roles

Contact roles and specialized service duties within departments are managed in the ministry_members table.


1. Ministry Rosters (ministry_members)

A contact is enrolled in a ministry by creating a record in public.ministry_members.

Core Schema Fields

  • ministry_id (uuid): References the parent department.
  • person_id (uuid): References the member profile.
  • role (text): The specific duty or assignment within the ministry (defaults to 'member').
  • joined_at (timestamptz): When the member was added to the ministry.

Role Specialization

Unlike group roles which use rigid enums, ministry roles are open text fields. This allows organizations to define custom roles matching their workflow:

  • Worship Department: "Lead Vocalist", "Acoustic Guitarist", "Sound Engineer".
  • Media Department: "Camera Operator", "Slide Controller", "Streaming Administrator".
  • Ushers Department: "Greeter", "Section Leader", "Security Coordinator".

2. Ministry-Scoped Permissions (service_id)

The dynamic RBAC system supports scoping permission keys (like ministries.manage) to specific ministries. This assignment is configured in user_church_roles via the service_id column.

[User Session]

      ├─► Global Role: (service_id = NULL) ──► Full Org Access

      └─► Scoped Role: (service_id = 999)  ──► Scoped Access (Only Ministry 999)

Scoped Operations

  • Department Autonomy: A team leader with a role scoped to a specific service_id receives full management permissions (such as editing rosters or creating schedules) only for their department.
  • Data Protection: Scoped leaders are blocked from viewing or editing rosters of other departments.
  • Frontend Integration: The usePermissions hook resolves these scopes through the helper method canForService(permissionKey, serviceId), enabling or disabling controls dynamically.