11defmodule Console.GraphQl.Users do
22 use Console.GraphQl.Schema.Base
33 alias Console.GraphQl.Resolvers.User
4- alias Console.Middleware . { Authenticated , AdminRequired , AllowJwt }
4+ alias Console.Middleware . { Authenticated , AdminRequired , AllowJwt , Sandboxed }
55 alias Console.Schema.Notification . { Severity , Status }
66
77 enum_from_list :permission , Console.Schema.Role , :permissions , [ ]
@@ -216,6 +216,7 @@ defmodule Console.GraphQl.Users do
216216
217217 field :signup , :user do
218218 middleware AllowJwt
219+ middleware Sandboxed
219220 arg :invite_id , non_null ( :string )
220221 arg :attributes , non_null ( :user_attributes )
221222
@@ -232,13 +233,15 @@ defmodule Console.GraphQl.Users do
232233
233234 field :create_invite , :invite do
234235 middleware Authenticated
236+ middleware Sandboxed
235237 arg :attributes , non_null ( :invite_attributes )
236238
237239 resolve safe_resolver ( & User . create_invite / 2 )
238240 end
239241
240242 field :update_user , :user do
241243 middleware Authenticated
244+ middleware Sandboxed
242245 arg :id , :id
243246 arg :attributes , non_null ( :user_attributes )
244247
@@ -248,6 +251,7 @@ defmodule Console.GraphQl.Users do
248251 field :create_group , :group do
249252 middleware Authenticated
250253 middleware AdminRequired
254+ middleware Sandboxed
251255 arg :attributes , non_null ( :group_attributes )
252256
253257 resolve safe_resolver ( & User . create_group / 2 )
@@ -256,6 +260,7 @@ defmodule Console.GraphQl.Users do
256260 field :delete_group , :group do
257261 middleware Authenticated
258262 middleware AdminRequired
263+ middleware Sandboxed
259264 arg :group_id , non_null ( :id )
260265
261266 resolve safe_resolver ( & User . delete_group / 2 )
@@ -264,6 +269,7 @@ defmodule Console.GraphQl.Users do
264269 field :update_group , :group do
265270 middleware Authenticated
266271 middleware AdminRequired
272+ middleware Sandboxed
267273 arg :group_id , non_null ( :id )
268274 arg :attributes , non_null ( :group_attributes )
269275
@@ -273,6 +279,7 @@ defmodule Console.GraphQl.Users do
273279 field :create_group_member , :group_member do
274280 middleware Authenticated
275281 middleware AdminRequired
282+ middleware Sandboxed
276283 arg :group_id , non_null ( :id )
277284 arg :user_id , non_null ( :id )
278285
@@ -282,6 +289,7 @@ defmodule Console.GraphQl.Users do
282289 field :delete_group_member , :group_member do
283290 middleware Authenticated
284291 middleware AdminRequired
292+ middleware Sandboxed
285293 arg :group_id , non_null ( :id )
286294 arg :user_id , non_null ( :id )
287295
@@ -291,6 +299,7 @@ defmodule Console.GraphQl.Users do
291299 field :create_role , :role do
292300 middleware Authenticated
293301 middleware AdminRequired
302+ middleware Sandboxed
294303 arg :attributes , non_null ( :role_attributes )
295304
296305 resolve safe_resolver ( & User . create_role / 2 )
@@ -299,6 +308,7 @@ defmodule Console.GraphQl.Users do
299308 field :update_role , :role do
300309 middleware Authenticated
301310 middleware AdminRequired
311+ middleware Sandboxed
302312 arg :id , non_null ( :id )
303313 arg :attributes , non_null ( :role_attributes )
304314
@@ -308,6 +318,7 @@ defmodule Console.GraphQl.Users do
308318 field :delete_role , :role do
309319 middleware Authenticated
310320 middleware AdminRequired
321+ middleware Sandboxed
311322 arg :id , non_null ( :id )
312323
313324 resolve safe_resolver ( & User . delete_role / 2 )
0 commit comments