Skip to content

Conversation

@vkarpov15
Copy link
Member

Summary

  • add an updateWorkspaceMember action that enforces authorization checks before updating a member role
  • expose the action via a Netlify function entry point
  • cover the new action with unit tests and extend the shared test setup timeout
  • remove the manual Mocha timeout overrides from the shared test setup

Testing

  • MONGODB_CONNECTION_STRING='mongodb://127.0.0.1:27017/mongoose_test?serverSelectionTimeoutMS=1000' npm test (fails: MongoDB server is unavailable in the test environment)

https://chatgpt.com/codex/tasks/task_e_68ed6bc4aeec8324939b8980fef0b401

@netlify
Copy link

netlify bot commented Oct 13, 2025

Deploy Preview for mongoose-js ready!

Name Link
🔨 Latest commit f7016ce
🔍 Latest deploy log https://app.netlify.com/projects/mongoose-js/deploys/68ed6f7348aea3000872d38d
😎 Deploy Preview https://deploy-preview-20--mongoose-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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

Comment on lines +51 to +53
member.roles = [role];
await workspace.save();

Choose a reason for hiding this comment

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

P1 Badge Enforce subscription limits before promoting members

The new action sets member.roles and saves the workspace without checking whether the workspace has a paid subscription or available seats when elevating someone from a free dashboards role to admin/member. inviteToWorkspace explicitly blocks adding paid members on non‑pro plans (subscriptionTier !== 'pro' and numPaidUsers > 0), but this update path skips that validation, so an admin can invite a user as a free dashboards member and immediately promote them to a paid role without triggering any billing enforcement or Stripe provisioning.

Useful? React with 👍 / 👎.

@vkarpov15 vkarpov15 merged commit a1f635d into master Oct 13, 2025
6 checks passed
@vkarpov15 vkarpov15 deleted the codex/add-updateworkspacemember-action branch October 13, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants