mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-16 08:03:02 +00:00
* feat: allow non-admin users to create HTTP triggers with forced workspaced routes Non-admin users can now create and fully edit HTTP triggers, but are forced to use workspaced routes (workspace-prefixed URLs). Instance-wide routes remain admin-only to prevent cross-workspace URL conflicts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add missing RLS INSERT/DELETE policies for http_trigger table Non-admin users were blocked by row-level security when creating HTTP triggers. Added INSERT, DELETE, see_own, and see_member policies matching other trigger tables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: allow user paths for HTTP triggers Remove the hideUser restriction on the Path component so HTTP triggers can be created under user paths (u/username/...) in addition to folder paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove added note from instance settings description Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: allow non-admins to edit non-workspaced routes without changing route config Non-admins can now open and edit existing non-workspaced HTTP triggers (created by admins) as long as they don't modify route_path, http_method, or workspaced_route. The workspaced prefix is only forced on new triggers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: allow non-admins to change route_path on workspaced routes The prevent_route_path_change DB trigger blocked all route_path changes for windmill_user, even on workspaced routes. Now only instance-wide (non-workspaced) routes are protected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add explicit GRANT and force workspaced routes in OpenAPI generator - Add explicit GRANT INSERT, DELETE on http_trigger to windmill_user for safety on customer instances - Force workspaced_route: true for non-admins in OpenAPI route generator Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
965 B
PL/PgSQL
22 lines
965 B
PL/PgSQL
DROP POLICY IF EXISTS see_folder_extra_perms_user_insert ON http_trigger;
|
|
DROP POLICY IF EXISTS see_folder_extra_perms_user_delete ON http_trigger;
|
|
DROP POLICY IF EXISTS see_extra_perms_user_insert ON http_trigger;
|
|
DROP POLICY IF EXISTS see_extra_perms_user_delete ON http_trigger;
|
|
DROP POLICY IF EXISTS see_extra_perms_groups_insert ON http_trigger;
|
|
DROP POLICY IF EXISTS see_extra_perms_groups_delete ON http_trigger;
|
|
DROP POLICY IF EXISTS see_own ON http_trigger;
|
|
DROP POLICY IF EXISTS see_member ON http_trigger;
|
|
|
|
REVOKE INSERT, DELETE ON http_trigger FROM windmill_user;
|
|
|
|
-- Restore original prevent_route_path_change that blocks all non-admin route_path changes
|
|
CREATE OR REPLACE FUNCTION prevent_route_path_change()
|
|
RETURNS TRIGGER AS $$
|
|
BEGIN
|
|
IF CURRENT_USER = 'windmill_user' AND NEW.route_path <> OLD.route_path THEN
|
|
RAISE EXCEPTION 'Modification of route_path is only allowed by admins';
|
|
END IF;
|
|
RETURN NEW;
|
|
END;
|
|
$$ LANGUAGE plpgsql;
|