Skip to content

Commit

Permalink
Fix clone (#1037)
Browse files Browse the repository at this point in the history
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

Now works
http://localhost:3000/rest/project/clone/webstudiois

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
  • Loading branch information
istarkov authored Feb 16, 2023
1 parent 89a95c4 commit b652e21
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/trpc-interface/src/authorize/project.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ export const hasProjectPermit = async (
return true;
}

// Allow load webstudiois for clone
// @todo Rethink permissions for this use-case
// The plan is to make new permission for projects which are allowed to be publicly clonable by anyone
// https://github.com/webstudio-is/webstudio-builder/issues/1038
if (
props.permit === "view" &&
props.projectId === "62154aaef0cb0860ccf85d6e"
) {
return true;
}

// Edge-case to allow access the project on the canvas
if (
props.permit === "view" &&
Expand Down

0 comments on commit b652e21

Please sign in to comment.