Skip to content

Commit 29ded4e

Browse files
fix: Improve table formatting in authorization model documentation
1 parent 66730e6 commit 29ded4e

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

docs/authorization-model.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,35 @@ if (!canCreate.Succeeded) return Forbid();
9494

9595
Each composite method in `BaseAuthorizationHelper` has three branches:
9696

97-
| Resource | Behaviour |
98-
|----------|-----------|
99-
| Concrete (`GameType`, tuple) | Checks role for that specific game type |
100-
| `PotentialAccessProbe` | Checks if user holds any game-scoped role |
101-
| `null` | Does nothing (fail-closed) |
97+
| Resource | Behaviour |
98+
| ---------------------------- | ----------------------------------------- |
99+
| Concrete (`GameType`, tuple) | Checks role for that specific game type |
100+
| `PotentialAccessProbe` | Checks if user holds any game-scoped role |
101+
| `null` | Does nothing (fail-closed) |
102102

103103
`CheckDirectPermissionGrant` already handles all three — it checks for a scoped permission when a resource is present, and for **any** permission claim when no resource is provided.
104104

105105
### When to Use Each Pattern
106106

107-
| Scenario | Resource to Pass | Example |
108-
|----------|-----------------|---------|
109-
| Action on a known resource | The resource (`GameType`, `(GameType, Guid)`, etc.) | Edit button in a Details view |
110-
| UI gate before resource exists | `PotentialAccessProbe.Instance` | Create button on Index page, GET Create action |
111-
| Non-resource-scoped policy | Nothing (omit `policy-resource`) | Tags.Write, Dashboard.Read |
112-
| Data filtering (what to show) | N/A — use `ClaimedGamesAndItems` | Index action fetching records |
107+
| Scenario | Resource to Pass | Example |
108+
| ------------------------------ | --------------------------------------------------- | ---------------------------------------------- |
109+
| Action on a known resource | The resource (`GameType`, `(GameType, Guid)`, etc.) | Edit button in a Details view |
110+
| UI gate before resource exists | `PotentialAccessProbe.Instance` | Create button on Index page, GET Create action |
111+
| Non-resource-scoped policy | Nothing (omit `policy-resource`) | Tags.Write, Dashboard.Read |
112+
| Data filtering (what to show) | N/A — use `ClaimedGamesAndItems` | Index action fetching records |
113113

114114
## Key Implementation Files
115115

116116
These files are the **source of truth** for all authorization behaviour:
117117

118-
| File | Purpose |
119-
|------|---------|
120-
| `Auth/Constants/AuthPolicies.cs` | All policy name constants |
121-
| `Auth/Requirements/AuthRequirements.cs` | Marker requirement classes (one per policy) |
122-
| `Auth/PotentialAccessProbe.cs` | Sentinel resource for "can user potentially do X?" checks |
123-
| `Auth/Handlers/BaseAuthorizationHelper.cs` | Shared claim group definitions and common check methods |
124-
| `Auth/Handlers/*AuthHandler.cs` | Per-domain authorization handlers with exact role→permission logic |
125-
| `Extensions/PolicyExtensions.cs` | Policy registration wiring |
126-
| `Helpers/PolicyTagHelper.cs` | Razor tag helper for conditional rendering |
118+
| File | Purpose |
119+
| ------------------------------------------ | ------------------------------------------------------------------ |
120+
| `Auth/Constants/AuthPolicies.cs` | All policy name constants |
121+
| `Auth/Requirements/AuthRequirements.cs` | Marker requirement classes (one per policy) |
122+
| `Auth/PotentialAccessProbe.cs` | Sentinel resource for "can user potentially do X?" checks |
123+
| `Auth/Handlers/BaseAuthorizationHelper.cs` | Shared claim group definitions and common check methods |
124+
| `Auth/Handlers/*AuthHandler.cs` | Per-domain authorization handlers with exact role→permission logic |
125+
| `Extensions/PolicyExtensions.cs` | Policy registration wiring |
126+
| `Helpers/PolicyTagHelper.cs` | Razor tag helper for conditional rendering |
127127

128128
All paths are relative to `src/XtremeIdiots.Portal.Web/`.

0 commit comments

Comments
 (0)