aboutsummaryrefslogtreecommitdiff
path: root/migrations/auth
diff options
context:
space:
mode:
authorJohn Nduli2024-09-25 18:35:48 +0300
committerFrederick Muriuki Muriithi2024-09-25 16:40:30 -0500
commitef60b19dcb338ad80707ecffc5a959f3c6f66209 (patch)
treeca4402bc2bb62e9ea2db8a270b23ec6ba5c626fd /migrations/auth
parentfcd7880a1037ae2a4cbb521a5f9e748a7f1a1446 (diff)
downloadgn-auth-ef60b19dcb338ad80707ecffc5a959f3c6f66209.tar.gz
feat: add base implementation for hooks system
Diffstat (limited to 'migrations/auth')
-rw-r--r--migrations/auth/20240924_01_thbvh-hooks-for-edu-domains.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/migrations/auth/20240924_01_thbvh-hooks-for-edu-domains.py b/migrations/auth/20240924_01_thbvh-hooks-for-edu-domains.py
new file mode 100644
index 0000000..5c6e81d
--- /dev/null
+++ b/migrations/auth/20240924_01_thbvh-hooks-for-edu-domains.py
@@ -0,0 +1,24 @@
+"""
+hooks_for_edu_domains
+"""
+
+from yoyo import step
+
+__depends__ = {'20240819_01_p2vXR-create-forgot-password-tokens-table'}
+
+steps = [
+ step(
+ """
+ INSERT INTO roles(role_id, role_name, user_editable) VALUES
+ ('9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d', 'hook-role-from-edu-domain', '0')
+ """,
+ "DELETE FROM roles WHERE role_name='hook-role-from-edu-domain'"),
+ step(
+ """
+ INSERT INTO role_privileges(role_id, privilege_id) VALUES
+ ('9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d', 'group:resource:view-resource'),
+ ('9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d', 'group:resource:edit-resource')
+ """,
+ "DELETE FROM role_privileges WHERE role_id='9bb203a2-7897-4fe3-ac4a-75e6a4f96f5d'"
+ )
+]