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 CreateHome for external users #3323

Merged
merged 1 commit into from
Mar 16, 2022
Merged

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Mar 15, 2022

Description

External users, when logging in for the first time, have no role
assigned and are unable to create their home because that requires the
create-space permission. This assigns users that don't have a role assigned
to the default user role and persists that assignment in the settings
service so that CreateHome can pick it up when checking permissions
later.

This also disables the auto creation of the user's home in the reva
auth provider (i.e. when using basic auth) as the role assignement has
not happenend at that point. So the home creation will now always happen
in the CreateHome middleware in the proxy.

How Has This Been Tested?

  • manually

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:

@rhafer rhafer requested review from butonic and C0rby March 15, 2022 16:42
@update-docs
Copy link

update-docs bot commented Mar 15, 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.

proxy/pkg/user/backend/cs3.go Outdated Show resolved Hide resolved
External users, when logging in for the first time, have no role
assigned and are unable to create their home because that requires the
create-space permission. This assigns users that don't have a role assigned
to the default user role and persists that assignment in the settings
service so that CreateHome can pick it up when checking permissions
later.

This also disables the auto creation of the user's home in the reva
auth provider (i.e. when using basic auth) as the role assignement has
not happenend at that point. So the home creation will now always happen
in the CreateHome middleware in the proxy.
@sonarcloud
Copy link

sonarcloud bot commented Mar 16, 2022

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 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@rhafer rhafer merged commit 439c203 into owncloud:master Mar 16, 2022
ownclouders pushed a commit that referenced this pull request Mar 16, 2022
Merge: b3a1a14 6abf38d
Author: Ralf Haferkamp <rhaferkamp@owncloud.com>
Date:   Wed Mar 16 18:21:28 2022 +0100

    Merge pull request #3323 from rhafer/defaultrole

    Fix CreateHome for external users
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.

2 participants