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
Add modify_ansible_repo_content permission. #342
Conversation
|
WARNING!!! This PR is not attached to an issue. In most cases this is not advisable. Please see our PR docs for more information about how to attach this PR to an issue. |
fd52b0f
to
f7b503f
Compare
pulp_ansible/app/models.py
Outdated
| @@ -256,6 +256,8 @@ class AnsibleRepository(Repository): | |||
| class Meta: | |||
| default_related_name = "%(app_label)s_%(model_name)s" | |||
|
|
|||
| permissions = (("modify_ansible_repo_content", "Modify Ansible Repository Content"),) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize it when I susggested this name, but there is a naming conventions Permissions use. As is this reads in the list like this:
'Can add ansible repository',
'Can change ansible repository',
'Can delete ansible repository',
'Modify Ansible Repository Content',
'Can view ansible repository',
'Can add collection',
'Can change collection',
'Can delete collection',
So I think the name should be "Can modify ansible repository content".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the "codename" (the slug version) that list currently reads like:
'change_ansiblerepository',
'delete_ansiblerepository',
'modify_ansible_repo_content',
'view_ansiblerepository',
'add_collection',
'change_collection',
'delete_collection',
I think what we have right now is good.
f7b503f
to
c9a945a
Compare
| operations = [ | ||
| migrations.AlterModelOptions( | ||
| name='ansiblerepository', | ||
| options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': (('modify_ansible_repo_content', 'Modify Ansible Repository Content'),)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs the new string or the db will be incorrect.
c9a945a
to
9923ebc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thanks!
Adds
modify_ansible_repo_contentto theAnsibleRepositorymodel.