Skip to content

Fix: read/write access control for public repos #115

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

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

li-xin-yi
Copy link
Collaborator

@li-xin-yi li-xin-yi commented Dec 2, 2022

For a public repo, even an anonymous user can read everything in it, but only the owner and collaborators are allowed to edit. In this PR: we further distinguish the access for different roles in a repo, enforced the access rule both on the front-end and back-end side.

  • front-end: hide operation UI for guests, including auto saving button, runtime kernel in the sidebar, new code/scope menu
  • back-end: prohibit mutate query when auth fails

Besides, remove the awareness info (remote cursor/selection) of guests, only show the operation update from an owner/collaborator. A guest can never edit/run code in the pod or drag a pod.

image

Now, a public repo can also be shared with collaborators.

TODO

  • the resizing button and drag handles sometimes do not work properly when multiple users are collaborating on the repo.

Copy link
Collaborator

@lihebi lihebi left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@lihebi lihebi merged commit 0f2c6e7 into codepod-io:main Dec 2, 2022
@li-xin-yi li-xin-yi deleted the fix/write_read_control branch December 8, 2022 01:47
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