File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
diracx-routers/src/diracx/routers/pilots Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 12
12
PilotFieldsMapping ,
13
13
PilotStatus ,
14
14
)
15
- from diracx .core .properties import GENERIC_PILOT
15
+ from diracx .core .properties import GENERIC_PILOT , JOB_ADMINISTRATOR
16
16
from diracx .logic .pilots .management import (
17
17
delete_pilots as delete_pilots_bl ,
18
18
)
@@ -72,10 +72,17 @@ async def add_pilot_stamps(
72
72
if GENERIC_PILOT in user_info .properties :
73
73
if len (pilot_stamps ) != 1 :
74
74
raise HTTPException (
75
- status_code = status .HTTP_401_UNAUTHORIZED ,
75
+ status_code = status .HTTP_403_FORBIDDEN ,
76
76
detail = "As a pilot, you can only create yourself." ,
77
77
)
78
78
79
+ if JOB_ADMINISTRATOR not in user_info .properties :
80
+ if not vo == user_info .vo :
81
+ raise HTTPException (
82
+ status_code = status .HTTP_403_FORBIDDEN ,
83
+ detail = "You can create pilots only for your VO." ,
84
+ )
85
+
79
86
try :
80
87
await register_new_pilots (
81
88
pilot_db = pilot_db ,
You can’t perform that action at this time.
0 commit comments