@@ -98,7 +98,7 @@ func (h *HandlersAdmin) QueryRunPOSTHandler(w http.ResponseWriter, r *http.Reque
98
98
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
99
99
// Check permissions for query
100
100
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .QueryLevel , env .UUID ) {
101
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
101
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
102
102
return
103
103
}
104
104
// Parse request JSON body
@@ -252,7 +252,7 @@ func (h *HandlersAdmin) CarvesRunPOSTHandler(w http.ResponseWriter, r *http.Requ
252
252
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
253
253
// Check permissions
254
254
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .CarveLevel , env .UUID ) {
255
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
255
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
256
256
return
257
257
}
258
258
// Parse request JSON body
@@ -397,7 +397,7 @@ func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.R
397
397
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
398
398
// Check permissions for query
399
399
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .QueryLevel , env .UUID ) {
400
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
400
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
401
401
return
402
402
}
403
403
// Parse request JSON body
@@ -416,7 +416,7 @@ func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.R
416
416
case "delete" :
417
417
// Deleting queries only allowed to full admin users
418
418
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
419
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions to delete queries" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
419
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions to delete queries" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
420
420
return
421
421
}
422
422
for _ , n := range q .Names {
@@ -444,7 +444,7 @@ func (h *HandlersAdmin) QueryActionsPOSTHandler(w http.ResponseWriter, r *http.R
444
444
adminOKResponse (w , "queries activated successfully" )
445
445
case "saved_delete" :
446
446
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
447
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions to delete saved queries" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
447
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions to delete saved queries" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
448
448
return
449
449
}
450
450
for _ , n := range q .Names {
@@ -481,7 +481,7 @@ func (h *HandlersAdmin) CarvesActionsPOSTHandler(w http.ResponseWriter, r *http.
481
481
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
482
482
// Check permissions
483
483
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .CarveLevel , env .UUID ) {
484
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
484
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
485
485
return
486
486
}
487
487
// Parse request JSON body
@@ -498,7 +498,7 @@ func (h *HandlersAdmin) CarvesActionsPOSTHandler(w http.ResponseWriter, r *http.
498
498
switch q .Action {
499
499
case "delete" :
500
500
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
501
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions to delete carves" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
501
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions to delete carves" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
502
502
return
503
503
}
504
504
for _ , n := range q .IDs {
@@ -538,7 +538,7 @@ func (h *HandlersAdmin) ConfPOSTHandler(w http.ResponseWriter, r *http.Request)
538
538
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
539
539
// Check permissions
540
540
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , env .UUID ) {
541
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
541
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
542
542
return
543
543
}
544
544
// Parse request JSON body
@@ -725,7 +725,7 @@ func (h *HandlersAdmin) IntervalsPOSTHandler(w http.ResponseWriter, r *http.Requ
725
725
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
726
726
// Check permissions
727
727
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , env .UUID ) {
728
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
728
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
729
729
return
730
730
}
731
731
// Parse request JSON body
@@ -781,7 +781,7 @@ func (h *HandlersAdmin) ExpirationPOSTHandler(w http.ResponseWriter, r *http.Req
781
781
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
782
782
// Check permissions
783
783
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , env .UUID ) {
784
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
784
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
785
785
return
786
786
}
787
787
// Parse request JSON body
@@ -865,7 +865,7 @@ func (h *HandlersAdmin) NodeActionsPOSTHandler(w http.ResponseWriter, r *http.Re
865
865
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
866
866
// Check permissions
867
867
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
868
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
868
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
869
869
return
870
870
}
871
871
// Parse request JSON body
@@ -911,7 +911,7 @@ func (h *HandlersAdmin) EnvsPOSTHandler(w http.ResponseWriter, r *http.Request)
911
911
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
912
912
// Check permissions
913
913
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
914
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
914
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
915
915
return
916
916
}
917
917
// Parse request JSON body
@@ -1012,7 +1012,7 @@ func (h *HandlersAdmin) SettingsPOSTHandler(w http.ResponseWriter, r *http.Reque
1012
1012
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
1013
1013
// Check permissions
1014
1014
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
1015
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1015
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1016
1016
return
1017
1017
}
1018
1018
// Parse request JSON body
@@ -1086,7 +1086,7 @@ func (h *HandlersAdmin) UsersPOSTHandler(w http.ResponseWriter, r *http.Request)
1086
1086
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
1087
1087
// Check permissions
1088
1088
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
1089
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1089
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1090
1090
return
1091
1091
}
1092
1092
// Parse request JSON body
@@ -1232,7 +1232,7 @@ func (h *HandlersAdmin) TagsPOSTHandler(w http.ResponseWriter, r *http.Request)
1232
1232
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
1233
1233
// Check permissions
1234
1234
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
1235
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1235
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1236
1236
return
1237
1237
}
1238
1238
// Parse request JSON body
@@ -1315,7 +1315,7 @@ func (h *HandlersAdmin) TagNodesPOSTHandler(w http.ResponseWriter, r *http.Reque
1315
1315
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
1316
1316
// Check permissions
1317
1317
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
1318
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1318
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1319
1319
return
1320
1320
}
1321
1321
// Parse request JSON body
@@ -1380,7 +1380,7 @@ func (h *HandlersAdmin) PermissionsPOSTHandler(w http.ResponseWriter, r *http.Re
1380
1380
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
1381
1381
// Check permissions
1382
1382
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , users .NoEnvironment ) {
1383
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1383
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1384
1384
return
1385
1385
}
1386
1386
// Parse request JSON body
@@ -1445,7 +1445,7 @@ func (h *HandlersAdmin) EnrollPOSTHandler(w http.ResponseWriter, r *http.Request
1445
1445
ctx := r .Context ().Value (sessions .ContextKey (sessions .CtxSession )).(sessions.ContextValue )
1446
1446
// Check permissions
1447
1447
if ! h .Users .CheckPermissions (ctx [sessions .CtxUser ], users .AdminLevel , env .UUID ) {
1448
- adminErrorResponse (w , fmt .Sprintf ("%s has insuficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1448
+ adminErrorResponse (w , fmt .Sprintf ("%s has insufficient permissions" , ctx [sessions .CtxUser ]), http .StatusForbidden , nil )
1449
1449
return
1450
1450
}
1451
1451
// Parse request JSON body
0 commit comments