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

Improve integration with django-admin #9

Open
4 tasks
lucaswiman opened this issue Aug 24, 2016 · 0 comments
Open
4 tasks

Improve integration with django-admin #9

lucaswiman opened this issue Aug 24, 2016 · 0 comments
Assignees

Comments

@lucaswiman
Copy link
Contributor

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

@lucaswiman lucaswiman self-assigned this Aug 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant