From 3a82baec9d793edf81ac2b151b0f4d4159641375 Mon Sep 17 00:00:00 2001
From: Freya Murphy <freya@freyacat.org>
Date: Mon, 1 Apr 2024 11:09:25 -0400
Subject: login and register, liking on homepage

---
 db/rest/login/_api_validate_role.sql | 30 ------------------------------
 1 file changed, 30 deletions(-)
 delete mode 100644 db/rest/login/_api_validate_role.sql

(limited to 'db/rest/login/_api_validate_role.sql')

diff --git a/db/rest/login/_api_validate_role.sql b/db/rest/login/_api_validate_role.sql
deleted file mode 100644
index 9f1e54f..0000000
--- a/db/rest/login/_api_validate_role.sql
+++ /dev/null
@@ -1,30 +0,0 @@
-CREATE FUNCTION _api.validate_role()
-RETURNS TRIGGER
-LANGUAGE plpgsql VOLATILE
-AS $BODY$
-BEGIN
-	IF NOT EXISTS (
-		SELECT TRUE
-		FROM pg_catalog.pg_roles AS r
-		WHERE r.rolname = NEW.role
-	) THEN
-		PERFORM _api.raise(
-			_err => 500
-		);
-		RETURN NULL;
-	END IF;
-
-	RETURN NEW;
-END
-$BODY$;
-
-CREATE CONSTRAINT TRIGGER api_validate_role_trgr
-	AFTER INSERT OR UPDATE
-		ON admin.user
-			FOR EACH ROW
-				EXECUTE PROCEDURE _api.validate_role();
-
-GRANT EXECUTE ON FUNCTION _api.validate_role()
-	TO rest_anon, rest_user;
-GRANT SELECT ON TABLE pg_catalog.pg_roles
-	TO rest_anon, rest_user;
-- 
cgit v1.2.3-freya

