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

getRoleId: Fallback if no roleIDs in context #3420

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Mar 29, 2022

Description

When not using reva to mint the token the roleIDs of the user are not
part of the token (and not in the request context). Fallback to query
the settings service in that case.

Related Issue

#3167 (comment)

@rhafer rhafer requested review from C0rby and ScharfViktor March 29, 2022 15:50
@rhafer rhafer requested a review from kulmann as a code owner March 29, 2022 15:50
@rhafer rhafer self-assigned this Mar 29, 2022
@rhafer rhafer requested a review from pascalwengerter as a code owner March 29, 2022 15:50
@update-docs
Copy link

update-docs bot commented Mar 29, 2022

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.

When not using reva to mint the token the roleIDs of the user are not
part of the token (and not in the request context). Fallback to query
the settings service in that case.
@sonarqubecloud
Copy link

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

@rhafer rhafer merged commit f47bc81 into owncloud:master Mar 30, 2022
ownclouders pushed a commit that referenced this pull request Mar 30, 2022
Merge: 010d88b 0836ec1
Author: Ralf Haferkamp <[email protected]>
Date:   Wed Mar 30 17:50:18 2022 +0200

    Merge pull request #3420 from rhafer/getroleid

    getRoleId: Fallback if no roleIDs in context
@ScharfViktor
Copy link
Contributor

ScharfViktor commented Mar 30, 2022

I tested it. Everything works fine

  1. user with admin rights can create/share/delete space

  2. admin give to user Brian SpaceAdmin role
    curl --location --request POST 'https://localhost:9200/api/v0/settings/assignments-add' \ --header 'Authorization: Basic YWRtaW46YWRtaW4=' \ --header 'Content-Type: text/plain' \ --data-raw '{"account_uuid": "cc3290b6-db6d-43a9-92d7-fffbbc6ca0b6", "role_id": "2aadd357-682c-406b-8874-293091995fdd"}'
    Brian can create/share/delete space

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.

3 participants