Skip to content

Conversation

adityathebe
Copy link
Member

@adityathebe adityathebe commented Sep 27, 2025

resolves: #2634

  • Add tags support
  • Add roles as a subject
  • Add playbook as a subject
  • Fix refresh on Permission page
  • Person dropdown fix

Add Role tab as fourth option in permission form subject controls alongside Team, Person, and Notification. Role selection maps to subject field with subject_type set to "group" and supports admin, editor, viewer, responder, and commander roles.
Add playbook as a new subject type option in PermissionSubjectControls:
- Import FormikPlaybooksDropdown component
- Add "Playbook" to switch options and type union
- Handle playbook selection in state initialization and effects
- Set subject_type to "playbook" when playbook is selected
- Store selected playbook ID in subject field
Copy link

vercel bot commented Sep 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
aws-preview Ready Ready Preview Oct 1, 2025 7:04am
flanksource-ui Ready Ready Preview Oct 1, 2025 7:04am

Copy link

netlify bot commented Sep 27, 2025

Deploy Preview for goofy-euclid-75956c ready!

Name Link
🔨 Latest commit 800b094
🔍 Latest deploy log https://app.netlify.com/projects/goofy-euclid-75956c/deploys/68dcd1228d2670000845e056
😎 Deploy Preview https://deploy-preview-2635--goofy-euclid-75956c.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

netlify bot commented Sep 27, 2025

Deploy Preview for clerk-saas-ui ready!

Name Link
🔨 Latest commit 800b094
🔍 Latest deploy log https://app.netlify.com/projects/clerk-saas-ui/deploys/68dcd122da1e970008f5586e
😎 Deploy Preview https://deploy-preview-2635--clerk-saas-ui.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.

@adityathebe adityathebe requested a review from Copilot September 27, 2025 17:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the permissions system by adding tags support, expanding subject types to include roles and playbooks, and improving the refresh functionality. The changes enable more granular permission control through tags and broader subject coverage.

  • Add tags support for permissions with key-value mapping
  • Expand subject types to include roles and playbooks
  • Replace query client refresh with ref-based refetch mechanism

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/pages/Settings/PermissionsPage.tsx Switch from useQueryClient to ref-based refetch pattern
src/components/Permissions/PermissionsView.tsx Add onRefetch prop and playbook:* action option
src/components/Permissions/PermissionsTable.tsx Refactor RLS badge rendering from subject column to resource column with individual tag/agent badges
src/components/Permissions/ManagePermissions/Forms/PermissionSubjectControls.tsx Add Role and Playbook subject types with new dropdown components
src/components/Permissions/ManagePermissions/Forms/PermissionForm.tsx Add tags field with FormikKeyValueMapField
src/components/Forms/Formik/FormikRoleDropdown.tsx New dropdown component for role selection
src/api/types/permissions.ts Update type definitions with new subject types and tags field
src/api/services/users.ts Filter out system users and deleted users from person queries

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

netlify bot commented Sep 27, 2025

Deploy Preview for flanksource-demo-stable ready!

Name Link
🔨 Latest commit 800b094
🔍 Latest deploy log https://app.netlify.com/projects/flanksource-demo-stable/deploys/68dcd122824fa90008826364
😎 Deploy Preview https://deploy-preview-2635--flanksource-demo-stable.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.

- Remove RLS payload (tags/agents) from Subject column
- Add individual badges for each tag and agent in Resource column
- Display tags as "key: value" badges in blue
- Display agents as "agent: name" badges in gray
- Use inline layout for compact display alongside resource info
@moshloop
Copy link
Member

moshloop commented Sep 29, 2025

@adityathebe

  • I think we are missing the agent field
  • Role doesn't include guest
  • Add a code view/editor
  • Filter the permissions based on applicable resource
  • Add help for connection/playbook/etc..
  • I think subject should come first
  • Add a "ALL" resource (default) to global

* Move subject to the top
- Action dropdown now hidden until resource is selected
- Playbook resources show playbook-specific actions (run, approve, *)
- Other resources (catalog, component, connection, canary, global) show common actions only
… and playbooks

Unifies resource selection by using FormikResourceSelectorDropdown for both connection and playbook resources instead of their dedicated components, providing consistent filtering and search functionality across all resource types.
@adityathebe adityathebe force-pushed the feat/permission-form-tags branch from 7c480cb to 800b094 Compare October 1, 2025 06:58
@moshloop moshloop merged commit 7191163 into main Oct 1, 2025
16 of 18 checks passed
@moshloop moshloop deleted the feat/permission-form-tags branch October 1, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Permissions - Tag Support

2 participants