Commit 86b2e03
[One workflows] UI authorization gates (elastic#260260)
Closes elastic/security-team#16110
This PR aligns the Workflows UI with Kibana **Workflows** feature
sub-privileges (`application.capabilities.workflowsManagement.*`) and
related signals so users are not offered actions that reliably fail with
**403**.
---
## Summary
Below is a consolidated inventory of **gates implemented** (by surface).
Capability names match the UI keys from `WorkflowsManagementUiActions`
in `@kbn/workflows/common/privileges`.
### 1. Application shell
| Surface | Control / behavior | Required capability or condition |
Primary code |
| ------- | ------------------ | -------------------------------- |
------------ |
| Workflows app | All routes (`/`, `/create`, `/:id`) | `readWorkflow`
(`useWorkflowsCapabilities`), otherwise **Access Denied** (no child
routes mount) | `public/routes.tsx` (`WorkflowsReadPermissionsWrapper`)
|
---
### 2. List page and table
| Surface | Control / behavior | Required capability | Primary code |
| ------- | ------------------ | ------------------- | ------------ |
| List header | **Create** workflow | `createWorkflow` |
`pages/workflows/index.tsx` |
| List header | **Import** | `createWorkflow` |
`pages/workflows/index.tsx` |
| List table | Row **Enabled** toggle | `updateWorkflow` |
`features/workflow_list/ui/workflow_list.tsx` |
| List table | Row **Run** | `executeWorkflow` (+ workflow
enabled/valid) | `workflow_list.tsx` |
| List table | Row **Edit** | `updateWorkflow` | `workflow_list.tsx` |
| List table | Row **Clone** | `createWorkflow` | `workflow_list.tsx` |
| List table | Row **Delete** | `deleteWorkflow` | `workflow_list.tsx` |
| List table | Bulk **Enable** / **Disable** | `updateWorkflow` |
`use_workflow_bulk_actions.tsx` |
| List table | Bulk **Delete** | `deleteWorkflow` |
`use_workflow_bulk_actions.tsx` |
| Empty state | Create affordance | `createWorkflow` (from parent) |
`components/workflows_empty_state/workflows_empty_state.tsx` |
**Note:** **Export** (row and bulk) relies on app-level `readWorkflow`;
there is no separate export capability toggle in the UI.
---
### 3. Workflow detail — header and page
| Surface | Control / behavior | Required capability | Primary code |
| ------- | ------------------ | ------------------- | ------------ |
| Detail header | **Executions** tab | `readWorkflowExecution` |
`pages/workflow_detail/ui/workflow_detail_header.tsx` |
| Detail header | **Enabled** switch | `updateWorkflow` |
`workflow_detail_header.tsx` |
| Detail header | **Run** | `executeWorkflow` |
`workflow_detail_header.tsx` |
| Detail header | **Save** | `createWorkflow` (new) or `updateWorkflow`
(existing) | `workflow_detail_header.tsx` |
| Detail page | Executions **list** / **detail** UI |
`readWorkflowExecution` | `workflow_detail_page.tsx` |
---
### 4. Run / test modals
| Surface | Control / behavior | Required capability or signal | Primary
code |
| ------- | ------------------ | ----------------------------- |
------------ |
| Full-workflow **test** modal | Modal open / run | `executeWorkflow` |
`workflow_detail_test_modal.tsx` |
| **Execute** modal (Run + test title variants) | **Historical** tab |
`readWorkflowExecution` (disabled tab, tooltip, fallback initial tab) |
`workflow_execute_modal.tsx`, `workflow_execute_modal_helpers.ts`,
`workflow_execute_historical_form.tsx` under `features/run_workflow/ui/`
|
| **Execute** modal | **Alert** tab | RAC index prefetch / message
patterns on **`onError`** disable the tab | `workflow_execute_modal.tsx`
|
| **Execute** modal | **Manual** / **Index** / **Document** | Execute
path | `workflow_execute_modal.tsx` and related forms |
---
### 5. Editor — single step and YAML
| Surface | Control / behavior | Required capability | Primary code |
| ------- | ------------------ | ------------------- | ------------ |
| YAML gutter | **Run step** | `executeWorkflow` (disabled + tooltip via
shared helpers; denied → **Execute** privilege copy) |
`widgets/workflow_yaml_editor/ui/run_step_button.tsx`,
`shared/ui/workflow_action_buttons/get_workflow_tooltip_content.tsx` |
| Editor | **Run single step** handler | `executeWorkflow` |
`workflow_detail_editor.tsx` |
| **Test step** modal | Render / use | `executeWorkflow` |
`workflow_detail_test_step_modal.tsx` |
---
### 6. Execution detail
| Surface | Control / behavior | Required capability | Primary code |
| ------- | ------------------ | ------------------- | ------------ |
| Execution panel | **Replay** / **Run again** | `executeWorkflow` (+
syntax valid) | `workflow_execution_panel.tsx` |
| Execution panel | **Resume** | `executeWorkflow` |
`resume_execution_button.tsx` |
| Execution panel | **Cancel** | `cancelWorkflowExecution` |
`cancel_execution_button.tsx` |
---
### 7. Agent Builder — workflow YAML attachment
| Surface | Control / behavior | Required capability | Primary code |
| ------- | ------------------ | ------------------- | ------------ |
| Canvas (flyout) | **Save** (new YAML) | `createWorkflow` |
`features/ai_integration/attachment_renderers/workflow_yaml_attachment_renderer.tsx`
|
| Canvas | **Save as new** | `createWorkflow` | Same |
| Canvas | **Override** | `updateWorkflow` | Same |
| Canvas | **Open in editor** | `readWorkflow` | Same |
## 🎥 Demo
### User without read privilege
<img width="1788" height="1188" alt="Screenshot 2026-03-30 at 15 58 44"
src="https://github.com/user-attachments/assets/38b0aba3-4103-4967-927d-f0c5b89a2b33"
/>
### User with only read privilege
https://github.com/user-attachments/assets/dc72c6b5-1b30-42d0-a222-ec82fd0fd811
### User with read + update (no create)
https://github.com/user-attachments/assets/55568770-cfce-4f51-abc3-c6c0ef9388aa
### User with read + create (no update)
https://github.com/user-attachments/assets/8d73d89c-32dd-48a8-b499-825c423450a4
### User with execution capabilities (no read executions)
https://github.com/user-attachments/assets/bef9d6c4-275f-46ef-989a-0393f8a48885
### User with full execution capabilities
https://github.com/user-attachments/assets/0d27164e-8825-47cb-9432-03a374616b61
### User with CRUD capabilites
https://github.com/user-attachments/assets/f5e5b49d-0d86-4d68-8abc-0bcf480f2b30
### Full privileges user
https://github.com/user-attachments/assets/f4c29113-9373-4f09-bfd1-2d552d343b53
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>1 parent 74e99f2 commit 86b2e03
40 files changed
Lines changed: 2209 additions & 284 deletions
File tree
- src/platform
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 69 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
src/platform/plugins/shared/workflows_management/public/components/access_denied/access_denied.tsx
Lines changed: 202 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
0 commit comments