figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

[WIP] When using Bitbucket Read only tokens there's no indication that you can't make changes to tokens

Open Copilot opened this issue 9 months ago • 1 comments

  • [x] Fix the canWrite method in BitbucketTokenStorage.ts to correctly check permissions
    • Fixed the logical error in the condition permission === 'admin' || 'write' which was always true
    • Changed to permission === 'admin' || permission === 'write' to properly check permission values
  • [x] Modify the writeChangeset method to check for write access before attempting to push changes
    • Added canWrite check at the start of writeChangeset to prevent write operations for read-only tokens
    • Returns false immediately if user doesn't have write access
  • [x] Add a test to verify this behavior works correctly
    • Added new test case that verifies writeChangeset returns false when user has no write access
    • Fixed existing tests to properly test the new logic
  • [x] Created changeset to document the fix

Fixes #3322.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar May 21 '25 06:05 Copilot

🦋 Changeset detected

Latest commit: 27d1844f9bd4c5cf06f8ef79ae3339b24a69e6cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 21 '25 06:05 changeset-bot[bot]