Commit d4acfe4
committed
Skip disabled access rules when resolving the governing rule
AccessRule.Enabled was never checked, so a disabled rule still governed its
collections. Because selection is oldest-wins and structural, a disabled but
permissive rule (e.g. empty conditions, which auto-grant) could shadow a newer
enabled restrictive rule and silently grant access the active rule would have
gated.
Drop rules with Enabled == false from the candidate set, alongside the existing
deleted-rule skip, so a disabled rule stops governing entirely. Pin Enabled in
the resolver test fixtures so a governing rule is deterministically enabled
(AutoFixture's bool sequence could otherwise disable it), and add coverage for a
disabled sole rule (ungoverned) and a disabled oldest rule (newer enabled rule
governs).1 parent b16e1fa commit d4acfe4
2 files changed
Lines changed: 42 additions & 3 deletions
File tree
- bitwarden_license
- src/Services/Pam/Services
- test/Services/Pam.Test/Services
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
281 | 316 | | |
282 | 317 | | |
283 | 318 | | |
| |||
318 | 353 | | |
319 | 354 | | |
320 | 355 | | |
| 356 | + | |
| 357 | + | |
321 | 358 | | |
322 | 359 | | |
323 | 360 | | |
| |||
0 commit comments