Skip to content

docs(rbac): document unified RoleCode usage across Analysis, Dashboard & ETL (#536)#654

Merged
cct08311github merged 1 commit intodotnet8from
refactor/rbac-unified-docs-536
Mar 18, 2026
Merged

docs(rbac): document unified RoleCode usage across Analysis, Dashboard & ETL (#536)#654
cct08311github merged 1 commit intodotnet8from
refactor/rbac-unified-docs-536

Conversation

@cct08311github
Copy link
Copy Markdown
Owner

Summary

Documents the unified RBAC convention (all three modules use RoleCode) with no code changes — code was already correct.

  • wtm-developer-manual.md §10.4: add explicit note that AllowedRoles in [EnableAnalysis] / [Dimension] / [Measure] uses RoleCode, not RoleName; add correct/incorrect code examples
  • wtm-developer-manual.md §10.5 (new section): cross-module RBAC comparison table for Analysis, Dashboard, and ETL; explains each module's mechanism, role identifier, and Admin fast-path; warns against mixing RoleCode with RoleName
  • analysis-mode.md §8: expand security section to document VM-level and field-level AllowedRoles RBAC, IAnalysisFieldPolicy customisation, and the RoleCode rule
  • dashboard-dev-guide.md: update Sharing.Roles JSON examples to use correct RoleCode values; add explicit RoleCode vs RoleName warning; document DashboardOptions.AdminRoles configuration

What was already correct (no code changes needed)

Location Uses
_AnalysisController.CheckAccess() r.RoleCode
AnalysisWidgetDataSource.CheckAccess() r.RoleCode
AnalysisWidgetDataSource.BuildClaimsPrincipal() role.RoleCode for ClaimTypes.Role
_DashboardController.GetUserInfo() r.RoleCode
JsonFileDashboardService.CanAccess()/CanEdit() receives RoleCode[] from controller ✅

Test plan

  • dotnet build WalkingTec.Mvvm.sln -c Release passes (docs-only change)
  • Documentation is consistent — AllowedRoles examples all use RoleCode format
  • No breaking changes (docs only)

Closes #536

🤖 Generated with Claude Code

…d & ETL (#536)

- wtm-developer-manual.md §10.4: add explicit note that AllowedRoles in
  [EnableAnalysis] / [Dimension] / [Measure] uses RoleCode, not RoleName;
  add code examples showing correct vs incorrect usage
- wtm-developer-manual.md §10.5 (new): cross-module RBAC comparison table
  covering Analysis (attribute + IAnalysisFieldPolicy), Dashboard
  (Sharing.Roles), and ETL (standard PrivilegeFilter); explains Admin
  fast-path for each module; warns against mixing RoleCode with RoleName
- analysis-mode.md §8: expand security table entry for unauthorised access;
  add new "角色型存取控制" subsection documenting VM-level and field-level
  AllowedRoles, IAnalysisFieldPolicy customisation, and the RoleCode rule
- dashboard-dev-guide.md: update sharing-mode JSON examples to use
  "mode: roles" and RoleCodes; add explicit RoleCode vs RoleName warning;
  document AdminRoles configuration option

No code changes — all three modules were already consistently using RoleCode
(confirmed in _AnalysisController.CheckAccess, AnalysisWidgetDataSource,
BuildClaimsPrincipal, and _DashboardController.GetUserInfo).

Closes #536

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cct08311github cct08311github merged commit 1f9a83a into dotnet8 Mar 18, 2026
4 checks passed
@cct08311github cct08311github deleted the refactor/rbac-unified-docs-536 branch March 20, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: unify RBAC mechanism across Analysis, Dashboard, and ETL modules

1 participant