Version: 2.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Created: 2025-12-12
Last Updated: 2026-01-26
Status: Phase 2 (Hard Deprecation) - COMPLETE
Target Removal: Q2 2026
Related Spec: PF-30 (Permissions System V2)
Overview
Thepf_user_roles table is being deprecated in favor of the new Permissions System V2, which uses:
pf_user_role_assignments- User role assignments with site scopingpf_role_permissions- Permission mappings for system and custom rolespf_custom_roles- Organization-defined custom rolespf_module_permissions- Granular permission definitions
Deprecation Timeline
Phase 1: Soft Deprecation (COMPLETE)
Duration: 2025-12-12 - 2025-12-23| Item | Status |
|---|---|
New system (pf_user_role_assignments) active | ✅ |
Data migrated from pf_user_roles | ✅ |
Feature flag (permissions_v2_enabled) controls system | ✅ (Historical) |
pf_user_roles still exists (read-only for fallback) | ✅ |
Code uses hasMinimumRole() with V1 fallback | ✅ (Removed) |
Phase 2: Hard Deprecation (COMPLETE)
Duration: 2025-12-23 - 2026-01-26| Item | Status |
|---|---|
pf_user_roles becomes read-only | ✅ |
hasMinimumRole() removed from codebase | ✅ |
| All code uses V2 permission system | ✅ |
| All organizations migrated to V2 | ✅ |
| Feature flag logic removed | ✅ |
- ✅ Removed all
minRolechecks from code - ✅ Removed
hasMinimumRole()usage from components - ✅ All organizations have V2 enabled (mandatory)
- ✅ Removed
usePermissionsV2Enabledhook - ✅ Removed
isV2Enabled()from PermissionService - ✅ Updated documentation to reflect V2 is mandatory
Phase 3: Removal
Duration: After 180 days (Q3 2026)| Item | Status |
|---|---|
pf_user_roles table archived | 🗑️ |
hasMinimumRole() function removed | 🗑️ |
V1 fallback logic removed from PermissionService | 🗑️ |
minRole property removed from navigation items | 🗑️ |
- Final migration verification
- Archive
pf_user_rolestopf_user_roles_archive - Remove
minRolefrom all navigation item definitions - Clean up V1 compatibility code from codebase
Tables Affected
| Table | Current State | Phase 1 | Phase 2 | Phase 3 |
|---|---|---|---|---|
pf_user_roles | Active | Deprecated | Read-only | Archived |
pf_user_role_assignments | Active | Active | Active | Active |
pf_role_permissions | Active | Active | Active | Active |
pf_custom_roles | Active | Active | Active | Active |
pf_module_permissions | Active | Active | Active | Active |
Migration Checklist
For Developers
Code Changes
- Replace
user.role === 'admin'withuseHasPermission('module.entity.admin') - Replace
hasMinimumRole(role, 'staff')withhasPermission('module.entity.view') - Add
permissionproperty to all navigation items - Update RLS policies to use
pf_has_permission()helper - Remove direct references to
pf_user_rolestable
Navigation Items
- Add
permissionproperty to module nav items - Add
permissionproperty to nav groups - Keep
minRoleas fallback (Phase 1 only) - Test navigation filtering with V2 enabled
Testing
- Update unit tests to mock V2 permission hooks
- Add RLS tests for permission-based policies
- Test navigation visibility for different roles
- Verify custom roles work correctly
For Org Admins
- Enable V2 in Organization Settings → Security → Permissions
- Verify all users can access expected features
- Create custom roles if specialized access needed
- Assign permissions to custom roles
- Review audit logs for permission denials
Rollback Procedure
Quick Rollback (Disable V2) - NO LONGER SUPPORTED
Note: V2 is now mandatory. Rollback to V1 is not supported. Thepermissions_v2_enabled column exists for historical purposes only and is not checked by the application code.
If critical issues arise, contact the Platform Foundation team for assistance.
Full Rollback (Admin Only)
If critical issues require complete rollback:- Delete all
pf_user_role_assignmentsrecords tagged with_migrated_from_v1 - Delete all system role permission mappings from
pf_role_permissions - NOT delete records from the original
pf_user_rolestable (preserved for safety)
Re-Migrate After Rollback
If you need to re-migrate after a rollback:Compatibility Matrix
| Feature | V1 (minRole) | V2 (permission) | Migration Path |
|---|---|---|---|
| Role hierarchy | ✅ | ✅ (via system roles) | Automatic |
| Site-scoped access | ❌ | ✅ | New feature |
| Custom roles | ❌ | ✅ | New feature |
| Granular permissions | ❌ | ✅ | New feature |
| Navigation filtering | ✅ (minRole) | ✅ (permission) | Add permission prop |
| RLS policies | ✅ (role-based) | ✅ (permission-based) | Update policies |
Code Examples
Before (V1)
After (V2)
Monitoring
Key Metrics to Track
During the deprecation period, monitor:- Permission check latency - V2 should be <50ms
- V1 fallback rate - Should decrease over time
- Permission denial rate - Watch for unexpected increases
- Custom role adoption - Measure V2 feature usage
Telemetry Events
The PermissionService logs the following events:| Event | Description |
|---|---|
permission.check.v2 | V2 permission check executed |
permission.check.v1_fallback | Fell back to V1 role check |
permission.denied | Permission was denied |
permission.cache.hit | Cache hit (performance) |
Contact
For questions about this deprecation:- Spec Owner: Platform Foundation Team
- Documentation: See
specs/pf/permissions-v2-migration.md - Rollout Guide: See
specs/pf/permissions-v2-rollout.md
Changelog
| Date | Version | Change |
|---|---|---|
| 2025-12-12 | 1.0.0 | Initial deprecation plan created |
| 2026-01-26 | 2.0.0 | Phase 2 (Hard Deprecation) marked complete - V2 is mandatory, feature flag removed |