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

Management command/function to refresh permission objects #1137

Closed
atodorov opened this issue Sep 22, 2019 · 1 comment · Fixed by #1760
Closed

Management command/function to refresh permission objects #1137

atodorov opened this issue Sep 22, 2019 · 1 comment · Fixed by #1760

Comments

@atodorov
Copy link
Member

atodorov commented Sep 22, 2019

Permissions in Django are regular DB objects but they are created on the fly when we add new models. Some permissions are applied by default to the Tester group but this is only done for new installations, usually upon first login.

Also when removing objects Django doesn't remove stale permissions from the database but happily introduces the new ones.

Because all of this happens dynamically trying to update these permissions in a data migration doesn't usually work.

We should probably provide a management command that refreshes all permissions in the DB and takes care to correctly assign the defaults for the Tester group.

For reference see #881.

@atodorov
Copy link
Member Author

atodorov commented May 26, 2020

@schwarzkrieger see django.contrib.auth.management.create_permissions()

also tcms.utils.permissions

schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Jun 28, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Aug 9, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Aug 10, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Aug 21, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Sep 5, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Sep 6, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Sep 20, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Oct 4, 2020
schwarzkrieger added a commit to schwarzkrieger/Kiwi that referenced this issue Oct 28, 2020
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 a pull request may close this issue.

1 participant