feat(certifications): server actions + page guard
certifications.ts: create/update/delete/list cert types (gated by certifications.manage; delete refused once granted, archive instead), and grant/revoke/renew/listMemberCertifications/getMyCertifications (gated by certifications.grant, the Instructor capability). Grant verifies cert and target member are in-space and the cert is active, computes expiry from validity_months unless overridden, and relies on the partial unique index for one active grant per member+cert. Revoke is soft; nothing is ever deleted. getMyCertifications takes no params (member resolved from session; RLS restricts to own rows). certifications-guard.ts mirrors the forms guard for the admin pages. Barrel re-export and API_REFERENCE updated.
This commit is contained in:
@@ -47,3 +47,6 @@ export * from './permissions'
|
||||
|
||||
// Custom forms and waivers
|
||||
export * from './forms'
|
||||
|
||||
// Certifications + Instructor capability
|
||||
export * from './certifications'
|
||||
|
||||
Reference in New Issue
Block a user