Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Benefits admin permissions as methods on ModelAdmin classes #2658

Open
3 tasks
angela-tran opened this issue Jan 31, 2025 · 0 comments
Open
3 tasks

Comments

@angela-tran
Copy link
Member

From the discussion in #2654 (comment), we've decided the logic that decides which models a user or group can access and their level of access should be defined explicitly in code instead of using the built-in permissions system from Django. This would make it more similar to how we define which fields a user or group can access and their level of access.

This means that the permissions we've been adding to the Cal-ITP staff group should instead be implemented by overriding the has_view_permission, has_change_permission, has_delete_permission, and has_add_permission on the ModelAdmins we've defined.

We'll also want to remove any UI that exposes the permission system since it won't have any effect.

  • "Permissions" field on Group
  • "User permissions" field on User

Acceptance Criteria

  • Cal-ITP group has same levels of access to models as before
  • No UI in Benefits Admin that does anything with Permission objects
  • Unit tests for our new methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Stretch
Development

No branches or pull requests

2 participants