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

Group edit: add more permissions #1085

Merged
merged 8 commits into from
Oct 27, 2021
Merged

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Oct 15, 2021

Fixes AAH-1024

Follow-up to #1002, after ansible/galaxy_ng#1003 .. add the newly added permissions to the UI.

I've added all permissions mentioned in the backend PR to HUMAN_PERMISSIONS and to PERMISSIONS, together with a comment showing their name in user.model_permissions, parenthesised if unused.

.. except we don't have all the permissions in PERMISSIONS, only those that get used, so commenting the new unused ones out.

Newly exposed permissions (these are the same that get used as of #1002)

  • ansible.delete_collection
  • container.delete_containerrepository
  • galaxy.add_containerregistryremote
  • galaxy.change_containerregistryremote
  • galaxy.delete_containerregistryremote
  • galaxy.delete_namespace

New permissions not made visible (gleamed from ansible/galaxy_ng#1003):

ansible.add_ansibledistribution
ansible.delete_ansibledistribution
ansible.add_collectionremote
ansible.delete_collectionremote
container.add_containerdistribution
container.change_containerdistribution
container.delete_containerdistribution
container.add_containerrepository
container.change_containerrepository
container.delete_containernamespace

(we have human names for all of these, so all we need is to uncomment them if needed)


With the added permissions, I was able to:

  • add remote registry
  • change a remote registry
  • delete a remote registry
  • delete a collection
  • delete a namespace
  • delete a local EE
  • delete a remote EE

@himdel himdel added the backport-4.4 This PR should be backported to stable-4.4 (2.1) label Oct 15, 2021
@himdel himdel marked this pull request as ready for review October 18, 2021 19:30
@newswangerd
Copy link
Member

This looks good. The only thing I would change is to reword "Remotes" to "Collection Remotes" and "Namepsaces" to "Collection Namespaces"
Screen Shot 2021-10-25 at 2 33 33 PM
.

@himdel
Copy link
Collaborator Author

himdel commented Oct 27, 2021

20211027140553

Updated, thanks :)

@himdel himdel merged commit 723f4cc into ansible:master Oct 27, 2021
@himdel himdel deleted the group-permissions branch October 27, 2021 14:36
@patchback
Copy link

patchback bot commented Oct 27, 2021

Backport to stable-4.4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4.4/723f4cc5bbdbd27e89a08d1011b5b8fd120e4a8d/pr-1085

Backported as #1139

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Oct 27, 2021
* merge HUMAN_GROUP_DETAIL_PERMISSIONS into PERMISSIONS[*].label

* PERMISSIONS: add permissions used in 1002

These model_permissions can now get used by the UI,
adding the appropriate constants ( https://github.com/ansible/galaxy_ng/pull/1003/files#diff-416aea42d5d99e187f7340543709cb3b126924b4fe30e6c36be869388c997845R141 ):

   add_containerregistry
   change_containerregistry
   delete_collection
   delete_containerregistry
   delete_containerrepository
   delete_namespace

* PERMISSIONS: annotate each real permission name with the model_permissions name

for permissions used by the ui

* PERMISSIONS: add (commented out) unused permissions from CurrentUserSerializer

* HUMAN_PERMISSIONS: sort

* HUMAN_PERMISSIONS: add missing permissions

* cypress: update allPerms for new permissions

* adjust permission group names

(cherry picked from commit 723f4cc)
himdel added a commit that referenced this pull request Oct 27, 2021
* merge HUMAN_GROUP_DETAIL_PERMISSIONS into PERMISSIONS[*].label

* PERMISSIONS: add permissions used in 1002

These model_permissions can now get used by the UI,
adding the appropriate constants ( https://github.com/ansible/galaxy_ng/pull/1003/files#diff-416aea42d5d99e187f7340543709cb3b126924b4fe30e6c36be869388c997845R141 ):

   add_containerregistry
   change_containerregistry
   delete_collection
   delete_containerregistry
   delete_containerrepository
   delete_namespace

* PERMISSIONS: annotate each real permission name with the model_permissions name

for permissions used by the ui

* PERMISSIONS: add (commented out) unused permissions from CurrentUserSerializer

* HUMAN_PERMISSIONS: sort

* HUMAN_PERMISSIONS: add missing permissions

* cypress: update allPerms for new permissions

* adjust permission group names

(cherry picked from commit 723f4cc)

Co-authored-by: Martin Hradil <mhradil@redhat.com>
@github-actions github-actions bot added the backported-4.4 This PR has been backported to stable-4.4 (2.1) label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4.4 This PR should be backported to stable-4.4 (2.1) backported-4.4 This PR has been backported to stable-4.4 (2.1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants