[v0.5.52] — Admin Correctness & Permissions #10
nagarjuna-tella
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
v0.5.52 hardens the built-in admin interface.
The pattern is the same as the last two releases: find the places where behavior was inconsistent, undocumented, or silently wrong — and fix them. v0.5.50 did this for migrations. v0.5.51 did it for primitive field validation. v0.5.52 does it for the admin layer.
This is not an admin features release. The list view, permissions, bulk actions, CSRF handling, and M2M saves all existed before. This release makes them work correctly.
What Changed
Admin mounting is now consistent
The admin docs and implementation previously had multiple mounting patterns that produced different behavior. This release settles on one supported path:
Custom prefixes work:
Multi-site routing and namespacing are now more predictable when you have multiple admin sites registered.
CSRF cookies now follow the mounted prefix
If your admin is mounted at
/manage, the CSRF cookie path is now/manage. Previously it was hardcoded to/adminregardless of where the admin was actually mounted. Forms on custom-prefixed admin sites would break CSRF validation silently.Permission enforcement is now consistent
Admin permission handling had gaps across different views. They're closed:
The practical effect: what a user is allowed to do in the admin is now the same regardless of which view they're accessing.
Bulk actions check object-level permissions
Previously, a user with model-level access could execute bulk actions on any selected objects, even ones they shouldn't be able to modify individually.
Now bulk actions run object-level permission checks before acting on each selected object. Objects the user cannot access are skipped or denied explicitly — not silently included.
M2M saves are transactional
Many-to-many save handling had two problems:
Both are fixed. Related IDs are validated before any mutation. The update is transactional — if any ID is invalid, the relation is not touched.
Readonly fields are enforced on create and update
A crafted POST could previously set readonly fields by including them explicitly in
fieldsorfieldsets. They were readonly in the UI but not enforced server-side.Readonly fields are now rejected on both create and update paths.
Boolean checkboxes render correctly
A saved
Falsevalue was being converted to the non-empty string"False"before the template rendered it. Non-empty strings are truthy in Python, so the checkbox rendered as checked even though the stored value wasFalse.Fixed. Saved
Falserenders as unchecked.Admin list view is usable on real tables
The list view has been expanded with what you'd expect from a real admin:
AksaraFilterBackendis now the preferred nameDjangoFilterBackendwas a placeholder name from early development. The preferred name is nowAksaraFilterBackend.DjangoFilterBackendremains available as a compatibility alias — existing imports won't break:Compatibility
These changes may affect existing admin customizations:
For most users:
include_admin(app)and everything works as documented.Documentation
The admin docs have been significantly refreshed to match the actual implementation. Previous docs referenced
app.mount("/admin", admin)which was never a supported pattern. Updated areas:Validation
pip-audit: passing, no known vulnerabilitiesInstall
What's Next
The foundation-hardening work continues. After migrations (v0.5.50), primitive fields (v0.5.51), and admin (v0.5.52), the remaining ORM correctness items are next:
filter(field=None)→IS NULLsemanticsbulk_create/ write-path consistency withsave()Aksara is pre-1.0. This release improves admin correctness and permissions but does not constitute an external audit or production-readiness claim.
This discussion was created from the release [v0.5.52] — Admin Correctness & Permissions.
All reactions