Skip to content

Commit

Permalink
Added sql in end to end test for security invoker views
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyamsinghal committed Dec 20, 2024
1 parent 2bd69cd commit d392530
Showing 1 changed file with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,28 @@ BEGIN
PERFORM lo_unlink(loid);
END IF;
END;
$$ LANGUAGE plpgsql;
$$ LANGUAGE plpgsql;



-- SECURITY INVOKER VIEW
CREATE TABLE public.employees (
employee_id SERIAL PRIMARY KEY,
first_name VARCHAR(100),
last_name VARCHAR(100),
department VARCHAR(50)
);

INSERT INTO public.employees (first_name, last_name, department)
VALUES
('Alice', 'Smith', 'HR'),
('Bob', 'Jones', 'Finance'),
('Charlie', 'Brown', 'IT'),
('Diana', 'Prince', 'HR'),
('Ethan', 'Hunt', 'Security');

CREATE VIEW public.view_explicit_security_invoker
WITH (security_invoker = true) AS
SELECT employee_id, first_name
FROM public.employees;

0 comments on commit d392530

Please sign in to comment.