forked from pulp/pulp_ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
1,206 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Added Role Based Access Control for each endpoint. | ||
New default roles (creator, owner, viewer) have been added for ``AnsibleRepository``, ``AnsibleDistribution``, | ||
``CollectionRemote``, ``RoleRemote``, and ``GitRemote``. | ||
New detail role management endpoints (``my_permissions``, ``list_roles``, ``add_role``, | ||
``remove_role``) have been added to ``AnsibleRepository``, ``AnsibleDistribution``, ``CollectionRemote``, | ||
``GitRemote``, and ``RoleRemote``. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def v3_can_view_repo_content(request, view, action): | ||
""" | ||
Check if the repo is private, only let users with view repository permissions | ||
view the collections here. | ||
""" | ||
|
||
# TODO: add when private repositories are a thing | ||
# if "distro_base_path" in view.kwargs: | ||
# distro_base_path = view.kwargs["distro_base_path"] | ||
# repo = models.AnsibleDistribution.objects.get(base_path=distro_base_path).repository | ||
|
||
# if repo.is_private: | ||
# return request.user.has_perm("ansible.view_ansiblerepository") | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 3.2.18 on 2023-03-01 23:11 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('ansible', '0048_collectionversionmark'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='ansibledistribution', | ||
options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': [('manage_roles_ansibledistribution', 'Can manage roles on distributions')]}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='ansiblerepository', | ||
options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': [('rebuild_metadata_ansiblerepository', 'Can rebuild metadata on the repository'), ('repair_ansiblerepository', 'Can repair the repository'), ('sign_ansiblerepository', 'Can sign content on the repository'), ('sync_ansiblerepository', 'Can start a sync task on the repository'), ('manage_roles_ansiblerepository', 'Can manage roles on repositories'), ('modify_ansible_repo_content', 'Can modify repository content')]}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='collectionremote', | ||
options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': (('manage_roles_collectionremote', 'Can manage roles on collection remotes'),)}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='gitremote', | ||
options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': [('manage_roles_gitremote', 'Can manage roles on git remotes')]}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='roleremote', | ||
options={'default_related_name': '%(app_label)s_%(model_name)s', 'permissions': [('manage_roles_roleremote', 'Can manage roles on role remotes')]}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.