Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Improve integration with django-admin #9

@lucaswiman

Description

@lucaswiman

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.

cc @hrichards @jdavisp3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions