CS-472 Failed to mark video as completed

Merged
GI
4mo ago
+421-17

This is an automated pull request to merge chas/mark-video-as-custom-role into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Enabling the Employee Compliance obligation now auto-adds portal:read/update in both the app and API, fixing CS-472 where users couldn’t mark training videos as completed. Applies to new roles and updates, including roles created via API or outside the UI.

  • Bug Fixes
    • API: enforce compliance → portal on create/update (covers obligations-only and permissions-only), validate privilege escalation against the final merged permissions, avoid dup actions, and never auto-strip explicit portal when compliance is off.
    • App: sync the “Employee Compliance” toggle with portal in PermissionMatrix; disabling it removes portal, and unrelated permission edits don’t touch obligations.
    • Tests: coverage for no portal without compliance, deduped portal, obligations/permissions merges (incl. no-op updates), and privilege-escalation rejections.