From 2d948a63200440dd42f89e328826043035e79f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 29 Sep 2023 16:52:42 +0100 Subject: [PATCH] feat: Grant platformAdmin user update permissions --- hasura.planx.uk/metadata/tables.yaml | 7 +++++++ hasura.planx.uk/tests/users.test.js | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index 31a2b27ac6..ec848ee84c 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -1148,3 +1148,10 @@ filter: id: _eq: x-hasura-user-id + update_permissions: + - role: platformAdmin + permission: + columns: + - email + filter: {} + check: {} diff --git a/hasura.planx.uk/tests/users.test.js b/hasura.planx.uk/tests/users.test.js index 1b6be0c1d9..91149556e6 100644 --- a/hasura.planx.uk/tests/users.test.js +++ b/hasura.planx.uk/tests/users.test.js @@ -39,13 +39,13 @@ describe("users", () => { expect(i.queries).toContain("users"); }); - test("can creates users", () => { + test("can create and update users", () => { expect(i.mutations).toContain("insert_users"); + expect(i.mutations).toContain("update_users_by_pk"); + expect(i.mutations).toContain("update_users"); }); - test("cannot update or delete users", () => { - expect(i.mutations).not.toContain("update_users_by_pk"); - expect(i.mutations).not.toContain("update_users"); + test("cannot delete users", () => { expect(i.mutations).not.toContain("delete_users"); }); });