Skip to main content

RBAC Permissions Matrix

Purpose

This page documents the Role-Based Access Control (RBAC) model for Maqsafy dashboards and APIs.

The purpose of this matrix is to prevent unauthorized access, privilege escalation, cross-tenant data exposure, and incorrect access to financial or credential-related actions.

Roles

Role / Account CategoryDescriptionScope
AdminPlatform administrator with full governance and configuration accessPlatform-wide
EmployeeInternal or operational account category that may include manager, seller, parent, supplier, supplier driver, operator, supervisor, staff, automated call driver, and service provider account typesBased on assigned permissions and scope
School ManagerSchool management account that can manage school operations and may be linked to more than one schoolOne or more assigned schools only
SupplierSupplier account that manages its own products, orders, and invoicesAssigned supplier only
OperatorOperator account that may manage more than one cafeteriaAssigned cafeterias only
Service ProviderService provider account type used for service-related workflowsAssigned service provider scope
SupervisorSupervisor account/type used for operational supervision workflowsAssigned scope
StudentStudent account/category used for student-related access and flowsOwn student scope only

Confirmed Scope Rules

ScopeConfirmed Rule
School ManagerCan be linked to more than one school and must only access assigned schools
SupplierCan only access its own products, orders, and invoices
OperatorCan be linked to more than one cafeteria and must only access assigned cafeterias
StudentAccess is limited to the student's own permitted scope
Cross-tenant accessBlocked unless the account is explicitly assigned to that scope

Access Control Principles

  • Enforce RBAC on every protected API endpoint.
  • Enforce tenant scope on every database query.
  • Do not rely on frontend UI hiding alone.
  • Backend authorization must be mandatory.
  • Sensitive actions must be audited.
  • Financial and credential-related actions must have stricter authorization.
  • Any cross-tenant access must be blocked by default.
  • Unknown permissions must default to deny.

Permission Levels

LevelMeaning
NoneNo access
ViewCan read records only
CreateCan create new records
UpdateCan modify existing records
Delete / DeactivateCan deactivate or remove records where policy allows
ApproveCan approve workflow actions
ExportCan export data
Admin OnlyRestricted to Admin role only

High-Level Permission Matrix

Area / ActionAdminSchool ManagerSupplierOperator
View dashboardViewViewViewView
Manage platform settingsUpdateNoneNoneNone
Manage schoolsCreate / Update / DeactivateView / Update within scopeNoneNone
Manage cafeterias / branchesCreate / Update / DeactivateView / Update within school scopeNoneView / Update assigned scope
Manage dashboard usersCreate / Update / DeactivateNoneNoneNone
Assign roles and scopesUpdateNoneNoneNone
View permissions matrixViewNoneNoneNone
Manage school staff supervisor recordsViewCreate / Update within school scopeNoneNone
Assign supervisors to cafeteriasViewCreate / Update within school scopeNoneNone
Import / sync studentsViewCreate / Update within school scopeNoneNone
View student recordsViewView within school scopeNoneNone
Manage student spending policiesView / UpdateUpdate within school scopeNoneNone
Manage product master catalogCreate / UpdateNoneCreate / Update supplier products where allowedUpdate availability where allowed
Manage school product allowlist / denylistView / UpdateUpdate within school scopeNoneNone
Manage menu schedulesView / UpdateUpdate within school scopeNoneUpdate where allowed
View purchase ordersView allView within school scopeView assigned supplier ordersView assigned cafeteria orders
Create purchase ordersView / UpdateNoneNoneCreate where permitted
Accept / reject purchase ordersViewNoneUpdate assigned ordersNone
Confirm receivingViewView within school scopeNoneUpdate assigned cafeteria orders
View invoicesView allView within school scopeView supplier invoicesView assigned cafeteria invoices
Export invoices / settlementsExport allExport within school scope where allowedExport supplier scopeExport operator scope where allowed
View wallet balancesView allView within school scope where allowedView supplier walletView cafeteria wallet
View immutable ledgerView allView within school scope where allowedView supplier ledgerView cafeteria ledger
Submit withdrawal requestApprove / RejectNoneCreate where allowedCreate where allowed
Approve withdrawalsApproveNoneNoneNone
Initiate refund / return requestView / UpdateView within school scopeReview where applicableCreate assigned transaction requests
Approve / reject refund requestApprove where configuredApprove where configuredApprove supplier returns where applicableNone
View reportsView allView school reportsView supplier reportsView operator reports
Export reportsExport allExport within school scopeExport supplier scopeExport operator scope where allowed
Manage advertisementsCreate / UpdateCreate / Update school-level where enabledNoneCreate / Update where enabled
Manage support ticketsView / Update allCreate / Update own scopeCreate / Update own scopeCreate / Update own scope
View audit logsView allNone or limited by policyNoneNone
Manage integration settingsUpdateNoneNoneNone

Credential Permissions Matrix

Credential actions require special handling because credential identifiers are linked to student wallet access and lifecycle events.

Credential ActionAdminSchool ManagerParentStudentSupplierOperator
View credential inventoryView allView assigned school inventoryNoneNoneNoneNone
View credential identifier / codeView where policy allowsView where policy allowsNoneNoneNoneNone
Assign credential to studentCreate / UpdateCreate / Update within school scopeNoneNoneNoneNone
Record delivery statusView / UpdateUpdate within school scopeNoneNoneNoneNone
Cancel credentialAdmin OnlyNoneNoneNoneNoneNone
Activate / deactivate credentialUpdate according to configured permissions and assigned scopeUpdate within school scope according to configured permissionsUpdate own student scope according to configured permissionsUpdate own scope according to configured permissionsNoneNone
Replace credentialNeeds Technical VerificationNoneNoneNoneNoneNone
View credential lifecycle historyView allView within school scope where allowedNoneNoneNoneNone
Export credential distribution reportExport allExport assigned school scopeNoneNoneNoneNone

SRS Alignment Note — Credential Lifecycle Permissions

The previous SRS document stated that credential deactivation and replacement are Admin-only actions.

The technical management team has confirmed the following updated policy:

  • Cancellation is Admin-only.
  • Activation / deactivation can be performed by School Manager, Parent, and Student only according to configured permissions and assigned scope. This must not be interpreted as unrestricted access.
  • Replacement policy has not been fully confirmed. This item is marked as Needs Technical Verification and should not be treated as Admin-only based on SRS alone until the technical team provides confirmation.

This note must remain in documentation until the SRS is formally updated or the technical team provides a written decision on credential replacement authorization.

Tenant Isolation Rules

RuleDescription
School isolationSchool Manager must only access records under assigned school scope
Supplier isolationSupplier must only access products, orders, invoices, returns, and wallet data assigned to that supplier
Operator isolationOperator must only access assigned cafeteria/operator records
Admin auditabilityAdmin can access platform-wide data, but sensitive actions must be logged
Default denyIf scope cannot be verified, the request must be denied

Backend Enforcement Requirements

Every protected endpoint must verify:

  1. User is authenticated.
  2. User role is allowed.
  3. User permission allows the requested action.
  4. User scope matches the target resource.
  5. Sensitive action is audited.
  6. Response does not include fields outside the user’s permission scope.

Example Authorization Checklist

Use this checklist when creating or reviewing an endpoint.

CheckRequired
Authentication middleware appliedYes
Role check appliedYes
Permission check appliedYes
Tenant scope filter appliedYes
Sensitive fields filteredYes
Audit log added for sensitive actionYes
Test added for unauthorized accessYes
Test added for cross-tenant accessYes

Example: School Manager Access Rule

A School Manager can only access students where:

student.school_id IN assigned_school_ids

Invalid access example:

School Manager from School A requesting Student from School B

Expected result:

403 Forbidden

Example: Supplier Access Rule

A Supplier can only access purchase orders where:

purchase_order.supplier_id = authenticated_supplier_id

Expected unauthorized result:

403 Forbidden

Example: Operator Access Rule

An Operator can only access cafeteria records where:

cafeteria.operator_id = authenticated_operator_id

Expected unauthorized result:

403 Forbidden

Audit Requirements

The following actions must be audited:

  • Login failures
  • User creation or deactivation
  • Role and permission changes
  • School or cafeteria changes
  • Student import or status changes
  • Wallet balance adjustments
  • Refund actions
  • Withdrawal approvals
  • Credential assignment
  • Credential delivery update
  • Credential deactivation
  • Credential replacement
  • Export of sensitive reports
  • Integration configuration changes

Audit Log Fields

FieldDescription
actor_idUser who performed the action
actor_roleRole of the actor
actionAction performed
resource_typeTarget entity type
resource_idTarget entity ID
tenant_scopeSchool / supplier / operator scope
before_valuePrevious value where applicable
after_valueNew value where applicable
ip_addressRequest IP, where available
user_agentDevice or browser metadata, where available
created_atTimestamp

Testing Requirements

RBAC must be tested using positive and negative cases.

Test CaseExpected Result
Admin accesses platform-wide recordsAllowed
School Manager accesses assigned school recordsAllowed
School Manager accesses another school recordsDenied
Supplier accesses assigned supplier orderAllowed
Supplier accesses another supplier orderDenied
Operator accesses assigned cafeteria recordAllowed
Operator accesses another cafeteria recordDenied
School Manager cancels credentialDenied
Admin cancels credentialAllowed
School Manager activates / deactivates credential within assigned schoolAllowed where permissions configured
Parent activates / deactivates own student credentialAllowed only where configured permissions allow for the parent/student relationship
Student activates / deactivates own credentialAllowed only where configured permissions allow for the student's own scope
Unauthenticated user accesses protected endpointDenied
User exports report outside scopeDenied

Review Status

ItemStatus
RBAC roles confirmedConfirmed — Admin, Employee (with sub-types), Student
Permissions confirmed with product ownerConfirmed — See Technical Verification Update in Documentation Review Checklist
Backend middleware implementedNeeds Technical Verification
Tenant isolation testedConfirmed by technical team; Evidence Pending
Audit logs implementedNeeds Technical Verification
Negative access tests implementedNeeds Evidence
Sensitive exports reviewedNeeds Technical Verification
Credential cancellation Admin-onlyConfirmed
Credential activation/deactivation policyConfirmed — according to configured permissions and assigned scope; Evidence Pending
Credential replacement policyNeeds Technical Verification
SRS alignment note addedYes — See Credential Permissions Matrix above

Security Rules

  • Do not grant access based only on frontend visibility.
  • Do not trust user-submitted scope IDs.
  • Always derive scope from authenticated user context.
  • Do not expose student data outside authorized school scope.
  • Do not expose supplier or operator records across tenants.
  • Do not allow credential deactivation or replacement outside Admin role.
  • Deny by default when permission or scope is unclear.