Skip to content

Commit

Permalink
fix: Allow platformAdmins to insert users
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Sep 25, 2023
1 parent 927f945 commit bc23067
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 16 additions & 0 deletions hasura.planx.uk/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,8 @@
- slug
- theme
- updated_at
computed_fields:
- boundary_bbox
filter: {}
- role: public
permission:
Expand Down Expand Up @@ -1006,6 +1008,8 @@
- slug
- theme
- updated_at
computed_fields:
- boundary_bbox
filter: {}
update_permissions:
- role: platformAdmin
Expand Down Expand Up @@ -1073,6 +1077,18 @@
table:
schema: public
name: team_members
insert_permissions:
- role: platformAdmin
permission:
check: {}
columns:
- id
- first_name
- last_name
- created_at
- updated_at
- is_platform_admin
- email
select_permissions:
- role: platformAdmin
permission:
Expand Down
10 changes: 8 additions & 2 deletions hasura.planx.uk/tests/users.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ describe("users", () => {
expect(i.queries).toContain("users");
});

test("cannot create, update, or delete users", () => {
expect(i).toHaveNoMutationsFor("users");
test("can creates users", () => {
expect(i.mutations).toContain("insert_users");
});

test("cannot update or delete users", () => {
expect(i.mutations).not.toContain("update_users_by_pk");
expect(i.mutations).not.toContain("update_users");
expect(i.mutations).not.toContain("delete_users");
});
});

Expand Down

0 comments on commit bc23067

Please sign in to comment.