-
Notifications
You must be signed in to change notification settings - Fork 229
project/collaborators: implement ownership management #8669
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: master
Are you sure you want to change the base?
Conversation
6be9911 to
b4795a6
Compare
1f9dee6 to
8a97abf
Compare
8a97abf to
2552dd7
Compare
…ount – just uses up resources, when not used, and add delay after creating accounts
db46067 to
1e10ad7
Compare
…f cached values and add test
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
💡 Codex Review
cocalc/src/packages/server/projects/collab.ts
Lines 76 to 80 in ecc4be4
| try { | |
| // Ensure user is allowed to modify project(s) | |
| // | |
| await verify_write_access_to_projects(db, account_id, projects); | |
| } catch (err) { |
The new manage_users_owner_only/strict_collaborator_management enforcement is only applied in server/projects/collaborators.ts, but the public REST endpoint /api/v2/projects/collaborators/remove still calls remove_collaborators_from_projects, which only checks generic write access and never consults the owner-only flag. A collaborator can therefore POST to that endpoint and remove other collaborators even when the project or site setting is supposed to limit collaborator management to owners. This leaves the new restriction ineffective for clients using the REST API.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review latest change |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
450c20f to
549595f
Compare
|
@codex do another review of the last commit |
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.
💡 Codex Review
cocalc/src/packages/frontend/projects/actions.ts
Lines 643 to 647 in 549595f
| await this.redux | |
| .getProjectActions(project_id) | |
| .async_log({ event: "remove_collaborator", removed_name }); | |
| await webapp_client.project_collaborators.remove({ | |
| project_id, |
The project history entry for remove_collaborator is written before the backend call is made. With the new ownership checks (e.g., owner-only management or blocking owner removals), the server can now reject the removal, yet the log entry will already have been persisted, leaving an audit trail that claims a user was removed when nothing changed. Logging after a successful project_collaborators.remove call (as done for change_user_type below) would keep the history accurate.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
549595f to
e1570bd
Compare
noFirstProject:trueto many create account calls to avoid that. Also, in one tests was a delay with a cryptic note – copying that to several more placed, also account creation related. This makes more tests pass for me locally.screenshots
The panels below are from the perspective of a collaborator, with and without owner-only management of collaborators (adding/removing). In all situations, though, someone is able to remove oneself.
site setting, enforcing this setting for all projects
changing role
if there is just one owner left, the owner can't demote oneself