Commit 3f49182
committed
fix(authorization): restore is_staff bypass for configuration permissions
Under legacy authorization, is_staff is the catch-all bypass for object
and global permissions (see dojo/authorization/authorization.py
docstring + the existing user_has_global_permission code path). The
configuration-permission helper was the odd one out — it delegated
straight to Django's user.has_perm() and ignored is_staff, so a staff
user without explicit auth.* grants was 403'd by views and viewsets
gated on user_is_configuration_authorized / user_has_configuration_-
permission_or_403 (e.g. /user, /group, /api/v2/users/, etc.).
Add the is_staff (and is_superuser) bypass so configuration permissions
match the rest of the legacy contract. Django's user.has_perm() stays
as the fallback so explicit grants on non-staff users continue to work.
Pro overrides this function at runtime via
pro/apps.py:_shadow_authorization_symbols, so the OS bypass does not
leak into Pro deployments where RBAC governs configuration access.1 parent 83d2ff0 commit 3f49182
2 files changed
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
| 75 | + | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| |||
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
307 | 326 | | |
308 | 327 | | |
309 | 328 | | |
| |||
0 commit comments