You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
There are some rough edges with integration of baya with django-admin:
The READ permissions for BayaInlineMixin do not work correctly. AFAICT, a user who does not have UPDATE permissions also does not have READ permissions. This can be remedied by overriding get_readonly_fields to return all fields if the user lacks update permissions, and has_change_permission to allow users with update or read permissions.
Fields in a changeview still show up as form elements instead of their readonly display for users who lack UPDATE permissions. A better UX would be to show them as readonly by using get_readonly_fields.
The "save" buttons still show up for users who lack permissions to update the object. This can lead to user confusion. See this relevant, if hacky, StackOverflow post.
Nice to have: field-level access controls (Read/update). This would afford disallowing some users from seeing or updating sensitive fields, while still allowing them to see/update others. I think this can be implemented by overriding BayaModelAdmin.get_readonly_fields and BayaModelAdmin.get_fieldsets.
There are some rough edges with integration of baya with
django-admin
:BayaInlineMixin
do not work correctly. AFAICT, a user who does not have UPDATE permissions also does not have READ permissions. This can be remedied by overridingget_readonly_fields
to return all fields if the user lacks update permissions, andhas_change_permission
to allow users with update or read permissions.get_readonly_fields
.BayaModelAdmin.get_readonly_fields
andBayaModelAdmin.get_fieldsets
.cc @hrichards @jdavisp3
The text was updated successfully, but these errors were encountered: