fix access control

This commit is contained in:
SowinskiBraeden committed 2025-11-28 17:07:17 -08:00
1 parent d676f7d68c
commit b134fc0fe7
5 files changed
+18 -3

No files matched your search

+11 -3
View File
@@ -1,11 +1,19 @@
SET search_path TO lab_tracker_group_22;
-- 1. Create a role for TAs
CREATE ROLE ta_role;
-- 2. Allow this role to view your TA-related views
GRANT SELECT ON v_ta_progress_summary, v_section_overview TO ta_role;
GRANT SELECT ON ta_view, v_section_overview TO ta_role;
GRANT USAGE ON SCHEMA lab_tracker_group_22 TO ta_role;
-- 3. Create a demo user (only works if your server allows user creation)
CREATE USER ta_demo WITH PASSWORD 'ta_demo123';
-- 3. Create a demo user
CREATE USER ta_demo WITH PASSWORD 'superdupercoolta69';
-- 4. Give the demo user the TA role
GRANT ta_role TO ta_demo;
-- test
SET ROLE ta_role;
SELECT * FROM ta_view;