-
Notifications
You must be signed in to change notification settings - Fork 335
test(review): verify T0 revision-aware production flow #393
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
base: dev
Are you sure you want to change the base?
Changes from all commits
a080db4
5205081
81185d2
bd533b7
0c9d2eb
388d79a
8465aba
79d8a8f
5fee086
255d8c0
2f15721
29f135c
99b7626
a305975
e4a0f93
f0a2111
623a7ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||
| export type WorkspaceRole = "owner" | "member"; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export const reviewFixtureRevision = 6; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export function canDeleteWorkspace(role: WorkspaceRole): boolean { | ||||||||||||||||||||
| if (role === "owner") { | ||||||||||||||||||||
| return false; | ||||||||||||||||||||
|
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this authorization helper is used for deletion, the predicate is inverted: an Useful? React with 👍 / 👎.
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this authorization helper receives Useful? React with 👍 / 👎.
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| return true; | ||||||||||||||||||||
|
Comment on lines
+5
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win Fix the inverted deletion authorization. This currently allows members to delete workspaces and denies owners, creating a destructive authorization bypass. Return Proposed fix export function canDeleteWorkspace(role: WorkspaceRole): boolean {
- if (role === "owner") {
- return false;
- }
-
- return true;
+ return role === "owner";
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this predicate is used as the deletion authorization gate, it denies the Useful? React with 👍 / 👎.
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this authorization helper is called for a Useful? React with 👍 / 👎. |
||||||||||||||||||||
| } | ||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the caller supplies
"owner", this branch denies deletion, while"member"falls through totrue; this reverses the expected authorization policy and allows a less-privileged member to perform a destructive workspace operation while blocking the owner. Returntrueonly for the owner role.Useful? React with 👍 / 👎.