Skip to content

Commit c0e31bb

Browse files
committed
feature: restrict users from assigning any player to their match
1 parent f9893fc commit c0e31bb

2 files changed

Lines changed: 105 additions & 16 deletions

File tree

hasura/metadata/databases/default/tables/public_match_invites.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ insert_permissions:
1919
_and:
2020
- status:
2121
_eq: PickingPlayers
22-
- is_organizer:
23-
_eq: true
24-
- _and:
25-
- is_in_lineup:
22+
- _or:
23+
- is_organizer:
2624
_eq: true
2725
- options:
2826
lobby_access:
@@ -49,12 +47,9 @@ select_permissions:
4947
_or:
5048
- steam_id:
5149
_eq: X-Hasura-User-Id
52-
- _and:
53-
- match:
54-
is_in_lineup:
55-
_eq: true
56-
- invited_by_player_steam_id:
57-
_eq: X-Hasura-User-Id
50+
- match:
51+
is_in_lineup:
52+
_eq: true
5853
comment: ""
5954
delete_permissions:
6055
- role: user

hasura/metadata/databases/default/tables/public_match_lineup_players.yaml

Lines changed: 100 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,116 @@ object_relationships:
99
using:
1010
foreign_key_constraint_on: steam_id
1111
insert_permissions:
12-
- role: system_administrator
12+
- role: match_organizer
1313
permission:
1414
check: {}
1515
columns:
1616
- captain
1717
- match_lineup_id
1818
- steam_id
1919
comment: ""
20+
- role: streamer
21+
permission:
22+
check:
23+
_and:
24+
- lineup:
25+
v_match_lineup:
26+
match:
27+
is_organizer:
28+
_eq: true
29+
- _or:
30+
- _not:
31+
_exists:
32+
_table:
33+
name: settings
34+
schema: public
35+
_where:
36+
_and:
37+
- name:
38+
_eq: public.lineup_add_without_invite
39+
- _exists:
40+
_table:
41+
name: settings
42+
schema: public
43+
_where:
44+
_and:
45+
- name:
46+
_eq: public.lineup_add_without_invite
47+
- value:
48+
_in:
49+
- user
50+
- verified_user
51+
- streamer
52+
columns:
53+
- captain
54+
- match_lineup_id
55+
- steam_id
56+
comment: ""
2057
- role: user
2158
permission:
2259
check:
23-
lineup:
24-
v_match_lineup:
25-
match:
26-
is_organizer:
27-
_eq: true
60+
_and:
61+
- lineup:
62+
v_match_lineup:
63+
match:
64+
is_organizer:
65+
_eq: true
66+
- _or:
67+
- _not:
68+
_exists:
69+
_table:
70+
name: settings
71+
schema: public
72+
_where:
73+
_and:
74+
- name:
75+
_eq: public.lineup_add_without_invite
76+
- _exists:
77+
_table:
78+
name: settings
79+
schema: public
80+
_where:
81+
_and:
82+
- name:
83+
_eq: public.lineup_add_without_invite
84+
- value:
85+
_eq: user
86+
columns:
87+
- captain
88+
- match_lineup_id
89+
- steam_id
90+
comment: ""
91+
- role: verified_user
92+
permission:
93+
check:
94+
_and:
95+
- lineup:
96+
v_match_lineup:
97+
match:
98+
is_organizer:
99+
_eq: true
100+
- _or:
101+
- _not:
102+
_exists:
103+
_table:
104+
name: settings
105+
schema: public
106+
_where:
107+
_and:
108+
- name:
109+
_eq: public.lineup_add_without_invite
110+
- _exists:
111+
_table:
112+
name: settings
113+
schema: public
114+
_where:
115+
_and:
116+
- name:
117+
_eq: public.lineup_add_without_invite
118+
- value:
119+
_in:
120+
- user
121+
- verified_user
28122
columns:
29123
- captain
30124
- match_lineup_id

0 commit comments

Comments
 (0)