Skip to content

refactor: permission types#6417

Merged
kyle-ssg merged 197 commits intomainfrom
chore/permission-types
Mar 18, 2026
Merged

refactor: permission types#6417
kyle-ssg merged 197 commits intomainfrom
chore/permission-types

Conversation

@kyle-ssg
Copy link
Copy Markdown
Member

@kyle-ssg kyle-ssg commented Dec 16, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

How did you test this code?

E2E, checking each usage of permission

Note: due to amount of refactoring I've done, I've pointed this to the latest branch I've been working on

kyle-ssg and others added 30 commits August 5, 2025 16:27
Co-authored-by: Zaimwa9 <wadii.zaim@flagsmith.com>
# Conflicts:
#	frontend/web/components/pages/UserPage.tsx
# Conflicts:
#	frontend/common/providers/Permission.tsx
#	frontend/package-lock.json
#	frontend/package.json
#	frontend/web/components/feature-summary/FeatureRow.tsx
#	frontend/web/components/modals/FlagValueFooter.tsx
#	frontend/web/components/modals/create-feature/FeatureLimitAlert.tsx
#	frontend/web/components/modals/create-feature/index.js
#	frontend/web/components/modals/create-feature/tabs/CreateFeature.tsx
#	frontend/web/components/modals/create-feature/tabs/FeatureSettings.tsx
#	frontend/web/components/modals/create-feature/tabs/FeatureValue.tsx
#	frontend/web/components/mv/VariationOptions.tsx
#	frontend/web/components/navigation/navbars/ProjectNavbar.tsx
#	frontend/web/components/pages/FeaturesPage.js
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 25, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 10.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread frontend/e2e/playwright-report/trace/snapshot.html Fixed
Comment thread frontend/e2e/playwright-report/trace/snapshot.html Fixed
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Free Tier Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Autofix Details

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Tooltip uses raw description instead of full permission message
    • Updated the denied-permission tooltip to use Constants.environmentPermissions(Utils.getManageFeaturePermission(is4Eyes)) so the full message matches the actual permission being checked.
  • ✅ Fixed: Extra unused argument passed to getManageFeaturePermission
    • Removed the unused identity argument from all flagged calls to getManageFeaturePermission and getManageFeaturePermissionDescription to match their single-parameter signatures.

Create PR

Or push these changes by commenting:

@cursor push 20ff32a0d6
Preview (20ff32a0d6)
diff --git a/frontend/web/components/modals/create-feature/index.js b/frontend/web/components/modals/create-feature/index.js
--- a/frontend/web/components/modals/create-feature/index.js
+++ b/frontend/web/components/modals/create-feature/index.js
@@ -49,9 +49,8 @@
 import FeatureUpdateSummary from './FeatureUpdateSummary'
 import FeatureNameInput from './FeatureNameInput'
 import {
-    EnvironmentPermission,
-    EnvironmentPermissionDescriptions,
-    ProjectPermission,
+  EnvironmentPermission,
+  ProjectPermission,
 } from 'common/types/permissions.types'
 
 const Index = class extends Component {
@@ -1149,7 +1148,6 @@
                                                     tags={projectFlag.tags}
                                                     permission={Utils.getManageFeaturePermission(
                                                       is4Eyes,
-                                                      identity,
                                                     )}
                                                     id={
                                                       this.props.environmentId
@@ -1205,7 +1203,6 @@
                                                               savePermission,
                                                               Utils.getManageFeaturePermissionDescription(
                                                                 is4Eyes,
-                                                                identity,
                                                               ),
                                                               <Button
                                                                 onClick={() =>
@@ -1896,14 +1893,17 @@
                                       tags={projectFlag.tags}
                                       permission={Utils.getManageFeaturePermission(
                                         is4Eyes,
-                                        identity,
                                       )}
                                       id={this.props.environmentId}
                                     >
                                       {({ permission: savePermission }) =>
                                         Utils.renderWithPermission(
                                           savePermission,
-                                          EnvironmentPermissionDescriptions.UPDATE_FEATURE_STATE,
+                                          Constants.environmentPermissions(
+                                            Utils.getManageFeaturePermission(
+                                              is4Eyes,
+                                            ),
+                                          ),
                                           <div>
                                             <Button
                                               onClick={() => saveFeatureValue()}

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread frontend/web/components/modals/create-feature/index.js Outdated
Comment thread frontend/web/components/modals/create-feature/index.js
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  27.2 seconds
commit  4289db4
info  🔄 Run: #15234 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  53.6 seconds
commit  4289db4
info  🔄 Run: #15234 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  1 minute, 3 seconds
commit  4289db4
info  🔄 Run: #15234 (attempt 1)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  53.3 seconds
commit  4289db4
info  🔄 Run: #15234 (attempt 1)

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread frontend/web/components/pages/ProjectChangeRequestDetailPage.tsx
Comment thread frontend/common/providers/Permission.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  27.9 seconds
commit  18b2827
info  🔄 Run: #15240 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  48 seconds
commit  18b2827
info  🔄 Run: #15240 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  53.6 seconds
commit  18b2827
info  🔄 Run: #15240 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  18.1 seconds
commit  18b2827
info  🔄 Run: #15240 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  43.1 seconds
commit  d77370d
info  🔄 Run: #15331 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  46.3 seconds
commit  d77370d
info  🔄 Run: #15331 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  58.7 seconds
commit  d77370d
info  🔄 Run: #15331 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  53.5 seconds
commit  d77370d
info  🔄 Run: #15331 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  49.4 seconds
commit  fe307fc
info  🔄 Run: #15344 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  52.9 seconds
commit  3c63a02
info  🔄 Run: #15343 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  49.6 seconds
commit  3c63a02
info  🔄 Run: #15343 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  50.9 seconds
commit  d77370d
info  🔄 Run: #15345 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  50.6 seconds
commit  d77370d
info  🔄 Run: #15345 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  30.9 seconds
commit  3c63a02
info  🔄 Run: #15343 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  55.4 seconds
commit  3c63a02
info  🔄 Run: #15343 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  51 seconds
commit  fe307fc
info  🔄 Run: #15344 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 2 seconds
commit  fe307fc
info  🔄 Run: #15344 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  54.1 seconds
commit  d77370d
info  🔄 Run: #15345 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 1 second
commit  d77370d
info  🔄 Run: #15345 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  22.7 seconds
commit  b3159ac
info  🔄 Run: #15348 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  50.2 seconds
commit  b3159ac
info  🔄 Run: #15348 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  55.2 seconds
commit  b3159ac
info  🔄 Run: #15348 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  59.8 seconds
commit  b3159ac
info  🔄 Run: #15348 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  46 seconds
commit  be027bc
info  🔄 Run: #15354 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  47.7 seconds
commit  be027bc
info  🔄 Run: #15354 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  54.9 seconds
commit  be027bc
info  🔄 Run: #15354 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  1 minute, 3 seconds
commit  be027bc
info  🔄 Run: #15354 (attempt 1)

Comment thread frontend/common/types/permissions.types.ts Outdated
Comment thread frontend/common/utils/utils.tsx Outdated
talissoncosta
talissoncosta previously approved these changes Mar 18, 2026
Copy link
Copy Markdown
Contributor

@talissoncosta talissoncosta left a comment

Choose a reason for hiding this comment

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

Thanks @kyle-ssg — this is a key step forward. Really appreciate it! 🙌

# Conflicts:
#	frontend/web/components/modals/create-feature/tabs/CreateFeature.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API front-end Issue related to the React Front End Dashboard refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission check for editing an identities feature needs "UPDATE_FEATURE_STATE" permission

5 participants