Files
ruoyi-vue-pro/docs/education/migration/issues/EDU-012-classes-relationships.md

2.7 KiB

EDU-012 — Classes and education relationships

  • Status: implemented
  • Type: bounded vertical capability
  • Phase: 4
  • Decision: Education owns tenant-local classes and student/teacher relationships to existing Member identities. System RBAC remains the action-authorization boundary; class roles never become System roles. No platform tenant-ignore endpoint or supervision model is introduced in this slice.

Tenant-admin outcome

Tenant administrators manage classes, student education relationships, invitations, and supervision within explicit tenant and row-level scopes while Member/System remain the owners of generic users and roles.

Scope

  • Education class entity and membership relationships.
  • Student/teacher/class domain roles without duplicating System RBAC.
  • Invitations and duplicate-safe acceptance.
  • Education profile extensions.
  • Supervision relationships and data scopes if retained.
  • Audit and operation logging.

Delivered contract

  • V4140 creates education_class, education_class_member, education_class_invitation, and append-only invitation audit.
  • Both students and teachers are existing tenant-scoped Member users validated through MemberUserApi; Education stores only IDs and domain roles.
  • Management permissions are independent: education:class:create, education:class:query, education:class-member:query, and education:class-invitation:create. Permissions are provisioned separately by System RBAC and are not represented in class relationships.
  • All aggregate tenant IDs come from TenantContextHolder; tenant-qualified mapper predicates and PostgreSQL triggers reject cross-tenant relationships.
  • Invitation creation is idempotent per tenant, actor, and key with request-hash conflict detection. Acceptance locks the invitation, checks invitee and expiry, and writes relationship plus audit in one transaction.
  • This bounded slice intentionally excludes account creation, password handling, platform tenant-ignore operations, education profile duplication, and supervision relationships.

Acceptance criteria

  • Generic account, password, token, tenant, and role tables are not duplicated.
  • Student/teacher/class permission matrix is documented and tested.
  • Cross-class and cross-tenant access is denied.
  • Invitation acceptance is idempotent and auditable.
  • Platform-admin tenant-ignore operations are explicit and permission guarded (none are exposed by this bounded capability).
  • Database changes use flyway-postgresql.

Risk and rollback

  • Risk: High authorization and relationship-integrity risk.
  • Rollback: Disable management endpoints and correct relationships through audited forward operations.