mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
rbac: surface automations permissions in the UI
Backend already defined automations:create/read/update/delete/execute and seeded them on Owner/Editor/Viewer roles, but the Settings → Roles UI was missing the metadata to render them properly. - backend: add PERMISSION_DESCRIPTIONS entries for the 5 automations perms so the role editor stops falling back to "Permission for automations:create". - frontend: add automations to CATEGORY_CONFIG (Workflow icon, slotted between podcasts and connectors) so the role editor groups them as a real section. - frontend: extend the three ROLE_PRESETS — Editor and Contributor get create/read/update/execute (mirroring backend Editor); Viewer gets read. Prep work for the automations frontend; canPerform/usePermissionGate already handle the runtime gating, so no new hook is needed.
This commit is contained in:
parent
2b7d91aa03
commit
79f0218360
2 changed files with 22 additions and 0 deletions
|
|
@ -107,6 +107,12 @@ PERMISSION_DESCRIPTIONS = {
|
||||||
"settings:view": "View search space settings",
|
"settings:view": "View search space settings",
|
||||||
"settings:update": "Modify search space settings",
|
"settings:update": "Modify search space settings",
|
||||||
"settings:delete": "Delete the entire search space",
|
"settings:delete": "Delete the entire search space",
|
||||||
|
# Automations
|
||||||
|
"automations:create": "Create automations from chat or JSON",
|
||||||
|
"automations:read": "View automations, their triggers, and run history",
|
||||||
|
"automations:update": "Edit automations and manage their triggers",
|
||||||
|
"automations:delete": "Remove automations from the search space",
|
||||||
|
"automations:execute": "Manually fire automations",
|
||||||
# Full access
|
# Full access
|
||||||
"*": "Full access to all features and settings",
|
"*": "Full access to all features and settings",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import {
|
||||||
Unplug,
|
Unplug,
|
||||||
Users,
|
Users,
|
||||||
Video,
|
Video,
|
||||||
|
Workflow,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|
@ -126,6 +127,12 @@ const CATEGORY_CONFIG: Record<
|
||||||
description: "Generate AI podcasts from content",
|
description: "Generate AI podcasts from content",
|
||||||
order: 5,
|
order: 5,
|
||||||
},
|
},
|
||||||
|
automations: {
|
||||||
|
label: "Automations",
|
||||||
|
icon: Workflow,
|
||||||
|
description: "Scheduled and event-driven agent tasks",
|
||||||
|
order: 5.5,
|
||||||
|
},
|
||||||
connectors: {
|
connectors: {
|
||||||
label: "Connectors",
|
label: "Connectors",
|
||||||
icon: Unplug,
|
icon: Unplug,
|
||||||
|
|
@ -200,6 +207,10 @@ const ROLE_PRESETS = {
|
||||||
"podcasts:create",
|
"podcasts:create",
|
||||||
"podcasts:read",
|
"podcasts:read",
|
||||||
"podcasts:update",
|
"podcasts:update",
|
||||||
|
"automations:create",
|
||||||
|
"automations:read",
|
||||||
|
"automations:update",
|
||||||
|
"automations:execute",
|
||||||
"connectors:create",
|
"connectors:create",
|
||||||
"connectors:read",
|
"connectors:read",
|
||||||
"connectors:update",
|
"connectors:update",
|
||||||
|
|
@ -220,6 +231,7 @@ const ROLE_PRESETS = {
|
||||||
"comments:read",
|
"comments:read",
|
||||||
"llm_configs:read",
|
"llm_configs:read",
|
||||||
"podcasts:read",
|
"podcasts:read",
|
||||||
|
"automations:read",
|
||||||
"connectors:read",
|
"connectors:read",
|
||||||
"logs:read",
|
"logs:read",
|
||||||
"members:view",
|
"members:view",
|
||||||
|
|
@ -240,6 +252,10 @@ const ROLE_PRESETS = {
|
||||||
"comments:read",
|
"comments:read",
|
||||||
"llm_configs:read",
|
"llm_configs:read",
|
||||||
"podcasts:read",
|
"podcasts:read",
|
||||||
|
"automations:create",
|
||||||
|
"automations:read",
|
||||||
|
"automations:update",
|
||||||
|
"automations:execute",
|
||||||
"connectors:read",
|
"connectors:read",
|
||||||
"logs:read",
|
"logs:read",
|
||||||
"members:view",
|
"members:view",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue