Skip to content

Commit 2486153

Browse files
Adding OAuth2 scope to view (#841)
## Description <!-- Mandatory: Provide a clear, concise description of the changes and their purpose --> - What is being changed? Adding OAuth2 Scope to ServiceObjectDeleteViewSet - Why is this change needed? So that it does not get the default write permission. - How does this change address the issue? It wraps the permission class in a function like other views. ## Type of Change <!-- Mandatory: Check one or more boxes that apply --> - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Test update - [ ] Refactoring (no functional changes) - [ ] Development environment change - [ ] Configuration change ## Self-Review Checklist <!-- These items help ensure quality - they complement our automated CI checks --> - [x] I have performed a self-review of my code - [X] I have added relevant comments to complex code sections - [X] I have updated documentation where needed - [X] I have considered the security impact of these changes - [X] I have considered performance implications - [X] I have thought about error handling and edge cases - [X] I have tested the changes in my local environment ## Testing Instructions <!-- Optional for test-only changes. Mandatory for all other changes --> <!-- Must be detailed enough for reviewers to reproduce --> ### Prerequisites <!-- List any specific setup required --> ### Steps to Test 1. Run `python3 -m aap_gateway_api check --deploy --tag oauth2_permissions` from the gateway with this version of DAB 2. 3. ### Expected Results <!-- Describe what should happen after following the steps --> ## Additional Context <!-- Optional but helpful information --> ### Required Actions <!-- Check if changes require work in other areas --> <!-- Remove section if no external actions needed --> - [ ] Requires documentation updates <!-- API docs, feature docs, deployment guides --> - [ ] Requires downstream repository changes <!-- Specify repos: django-ansible-base, eda-server, etc. --> - [ ] Requires infrastructure/deployment changes <!-- CI/CD, installer updates, new services --> - [ ] Requires coordination with other teams <!-- UI team, platform services, infrastructure --> - [ ] Blocked by PR/MR: #XXX <!-- Reference blocking PRs/MRs with brief context --> ### Screenshots/Logs <!-- Add if relevant to demonstrate the changes -->
1 parent daf39a8 commit 2486153

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ansible_base/rbac/service_api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class ServiceObjectDeleteViewSet(viewsets.ViewSet):
154154
Handles both user and team assignments in a single API call.
155155
"""
156156

157-
permission_classes = [HasResourceRegistryPermissions]
157+
permission_classes = try_add_oauth2_scope_permission([HasResourceRegistryPermissions])
158158

159159
def create(self, request):
160160
"""

0 commit comments

Comments
 (0)