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

Give permissions better names #432

Merged
merged 11 commits into from
Nov 7, 2023
Merged

Give permissions better names #432

merged 11 commits into from
Nov 7, 2023

Conversation

amstilp
Copy link
Contributor

@amstilp amstilp commented Nov 3, 2023

Rename permissions to:

  • anvil_project_manager_edit -> anvil_consortium_manager_staff_edit
  • anvil_project_manager_view -> anvil_consortium_manager_staff_view
  • anvil_project_manager_limited_view -> anvil_consortium_manager_view

Rename auth mixins:

  • Edit -> StaffEdit
  • View -> StaffView
  • LimitedView -> View

Closes #400

This adds a *new* staff_edit permission as a *new* permission, and
keeps the previous edit permission. Not sure how to change the name
of the original edit permission to staff_edit.
Add a migration to create the new permissions, and then a data
migration to rename the original permissions (if they exist) to the
new permissions. This appears to work ok. We can't easily test this
because the django-test-migrations package mutes signals during the
migrations, so no ContentTypes or Permissions end up being created.
First attempt to rename the permissions, then add the new ones.
Just makes the source file a little cleaner.
@amstilp amstilp changed the title Give permissions sensible names Give permissions better names Nov 7, 2023
@amstilp amstilp marked this pull request as ready for review November 7, 2023 18:30
@amstilp amstilp merged commit d187048 into main Nov 7, 2023
18 checks passed
@amstilp amstilp deleted the feature/permission-rename branch November 7, 2023 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename permissions to more descriptive names
1 participant