RBAC Flow in Practice
Scenario
The rbac-flow example shows the full chain from login to route, button, and data-level permissions.
- Route:
/examples/rbac-flow - View:
src/views/examples/scaffold/rbac/index.vue
Permission Chain
- Load user profile, roles, and permissions after login.
- Generate accessible routes in
permission store. - Control page access with
requiredPermissions. - Control button visibility with
v-permission/PermissionButton. - Apply data masking or backend rejection for sensitive fields.
Naming Convention
system.user.viewsystem.user.createsystem.user.editsystem.user.delete
Implementation Notes
- Centralize checks in
usePermission. - Avoid complex inline template expressions.
- Sync route and UI state after permission changes.
Validation
- Compare behavior with
admin/123456anduser/123456. - Verify masked fields such as phone/email.
