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

[admin] Fix adminRestoreSoftDeletedWorkspace #4772

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

corneliusludmann
Copy link
Contributor

@corneliusludmann corneliusludmann commented Jul 12, 2021

The “Restore & Pin” link in the admin portal does not work. This PR fixes the rights check.

image

How to test

  1. Login with a user A. This user is the admin user.
  2. Login in another session (e.g. incognito window) with another user B. This user is a normal user.
  3. Start & stop a workspace with user B. Delete this workspace.
  4. Look for this workspace in the admin dashboard with user A. There should be a “Restore & Pin” link. Click it!
  5. Verify that the “Soft Deleted” column updates to “No” immediately for user A.
  6. Verify that user B has the workspace in the list of active workspaces (pinned).

It's important to do this with 2 users because in the previous implementation the problem was, that you can restore your own workspace only (due to the rights check).

Fixes #4583

@corneliusludmann corneliusludmann requested review from a team and geropl and removed request for a team July 12, 2021 13:28
@geropl
Copy link
Member

geropl commented Jul 13, 2021

/werft run

👍 started the job as gitpod-build-clu-fix-admin-restore-and-pin.4

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works as advertised.

A small reminder in favor of integration tests: large parts of the test could be automated. Don't want to block the PR, just to nag a bit 🙃

@corneliusludmann corneliusludmann merged commit a805386 into main Jul 13, 2021
@corneliusludmann corneliusludmann deleted the clu/fix-admin-restore-and-pin branch July 13, 2021 07:50
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.

[dashboard] restore & pin on doesn't work
2 participants