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

Disable non-owner editing. #4518

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

seanparsons
Copy link
Contributor

Problem:
When using the editor collaboratively, it doesn't make a lot of sense for non-owners to be able to change the project.

Fix:
In two places this prevents changes to the project model from being applied:

  • processAction: The main hub of where changes are applied we protect against non-owners from applying non-transient editor actions.
  • handleStrategies: Canvas interactions are disabled by having the entire strategies logic be disabled if the current user is not the owner of the project.

Additionally in processAction we prevent changes coming from non-owners via yjs/Liveblocks from being applied to the project model, as it appears initialisation of it in certain circumstances can cause those to be triggered.

Commit Details:

  • handleStrategies now short circuits if the project is not owned by the current user.
  • processAction now only permits certain actions to run depending on the ownership of the current project.

- `handleStrategies` now short circuits if the project is not owned by the current user.
- `processAction` now only permits certain actions to run depending on the ownership
  of the current project.
Copy link
Contributor

github-actions bot commented Nov 20, 2023

Try me

Copy link

relativeci bot commented Nov 20, 2023

Job #9255: Bundle Size — 65.59MiB (~+0.01%).

889fd11(current) vs 5957b21 master#9250(baseline)

Warning

Bundle contains 67 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change Regression 1 regression
                 Current
Job #9255
     Baseline
Job #9250
Regression  Initial JS 47.74MiB(~+0.01%) 47.74MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 18.33% 18.33%
No change  Chunks 25 25
No change  Assets 29 29
No change  Modules 4421 4421
No change  Duplicate Modules 469 469
No change  Duplicate Code 30.17% 30.17%
No change  Packages 458 458
No change  Duplicate Packages 67 67
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #9255
     Baseline
Job #9250
Regression  JS 65.58MiB (~+0.01%) 65.58MiB
Not changed  HTML 11.32KiB 11.32KiB

View job #9255 reportView feature/disable-non-owner-editin... branch activity

Copy link
Contributor

github-actions bot commented Nov 20, 2023

Performance test results:
(Chart1)
(Chart2)

@seanparsons seanparsons merged commit 786fe63 into master Nov 21, 2023
10 of 11 checks passed
@seanparsons seanparsons deleted the feature/disable-non-owner-editing branch November 21, 2023 13:37
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