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

Add modify_ansible_repo_content permission. #342

Merged
merged 1 commit into from Aug 12, 2020

Conversation

newswangerd
Copy link
Contributor

Adds modify_ansible_repo_content to the AnsibleRepository model.

@pulpbot
Copy link
Member

pulpbot commented Aug 10, 2020

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.

@newswangerd newswangerd force-pushed the add-repo-perms branch 3 times, most recently from fd52b0f to f7b503f Compare August 11, 2020 12:01
@newswangerd newswangerd mentioned this pull request Aug 12, 2020
8 tasks
@@ -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"),)
Copy link
Member

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".

Copy link
Member

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.

operations = [
migrations.AlterModelOptions(
name='ansiblerepository',
options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': (('modify_ansible_repo_content', 'Modify Ansible Repository Content'),)},
Copy link
Member

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.

Copy link
Member

@bmbouter bmbouter left a 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!

@bmbouter bmbouter merged commit 67df376 into pulp:master Aug 12, 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 this pull request may close these issues.

None yet

3 participants