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

fix the wrong status code when appRoleAssignments is forbidden #6037 #6276

Merged
merged 1 commit into from
May 12, 2023

Conversation

2403905
Copy link
Contributor

@2403905 2403905 commented May 10, 2023

fix the wrong status code when appRoleAssignments is forbidden #6037 #6035

Description

Fix the wrong status code when appRoleAssignments is forbidden in the CreateAppRoleAssignment and DeleteAppRoleAssignment methods.

Related Issue

How Has This Been Tested?

  • test environment: local
  • test case 1:
curl -kv -XPOST -u test1:test1 https://localhost:9200/graph/v1.0/users/df1105a3-1f5c-44e4-a1c4-a253f69faa89/appRoleAssignments \
-H 'Content-Type: application/json' \
-d '{"appRoleId":"2aadd357-682c-406b-8874-293091995fdd","resourceId":"application-1","principalId":"df1105a3-1f5c-44e4-a1c4-a253f69faa89"}'

{"error":{"code":"generalException","innererror":{"date":"2023-05-10T16:21:51Z","request-id":"Julias-MacBook-Pro.local/Bojl5NKzIT-000834"},"message":"{\"id\":\"ocis-settings\",\"code\":403,\"detail\":\"Changing own role assignment forbidden\",\"status\":\"Forbidden\"}"}}

Screenshots (if appropriate):

Types of changes

  • 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 change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented May 10, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@2403905 2403905 marked this pull request as ready for review May 10, 2023 16:24
@2403905 2403905 requested a review from kobergj May 10, 2023 16:26
@sonarcloud
Copy link

sonarcloud bot commented May 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@2403905 2403905 merged commit 554e109 into owncloud:master May 12, 2023
ownclouders pushed a commit that referenced this pull request May 12, 2023
fix the wrong status code when appRoleAssignments is forbidden #6037
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.

Admin user tries to change his/her own role gives 500 status code
3 participants