Commit 535b1bc
feat(authorization): reintroduce authorized_users M2M on Product / Product_Type
Forward-only schema migration adding authorized_users = M2M(Dojo_User) back
to Product and Product_Type. This is the foundation field for the legacy
permission model rewrite that replaces the RBAC role hierarchy with simple
membership checks (is_superuser, is_staff, or in authorized_users).
The field was originally on these models pre-DefectDojo#3757 (AuthZv2.0, late 2020)
and was removed in 0138_remove_authorized_users.py once auth-v2 became the
canonical authorization system. Reintroducing it now is the first step
toward unwinding auth-v2 from the upstream codebase while preserving
backward compatibility for installations that still want the RBAC tier
(those will continue to be served by the dojo-pro plugin).
This is a pure additive migration. The auth_role / dojo_global_role /
dojo_product_member / dojo_product_group / dojo_product_type_member /
dojo_product_type_group / dojo_dojo_group_member tables remain in the
database; they will be released from dojo's app state by a follow-up
SeparateDatabaseAndState migration so dojo-pro can adopt them.
Subsequent commits will:
- rewrite dojo/authorization/ contents to the legacy model
- add a data migration backfilling authorized_users from RBAC tables
- simplify ~117 callers and ~47 templates to the legacy action vocabulary
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fb6b069 commit 535b1bc
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
| |||
1169 | 1170 | | |
1170 | 1171 | | |
1171 | 1172 | | |
| 1173 | + | |
1172 | 1174 | | |
1173 | 1175 | | |
1174 | 1176 | | |
| |||
0 commit comments