Skip to content

Commit

Permalink
feat: grant extras
Browse files Browse the repository at this point in the history
  • Loading branch information
mul14 committed Sep 24, 2024
1 parent b67fde0 commit 0770271
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/supabase/query/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,20 @@ func BuildCreateRoleQuery(role objects.Role) string {
BEGIN
IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = '%s') THEN
CREATE ROLE %s WITH %s;
GRANT %s TO authenticator;
GRANT anon TO %s;
END IF;
END $$;
%s
GRANT %s TO authenticator;
COMMIT;`,
role.Name, role.Name, strings.Join(createRolClauses, "\n"),
configClause, role.Name,
role.Name,
role.Name,
strings.Join(createRolClauses, "\n"),
role.Name,
role.Name,
configClause,
role.Name,
)
}

Expand Down

0 comments on commit 0770271

Please sign in to comment.