4
4
# --- BEGIN_HEADER ---
5
5
#
6
6
# vgridman - backend to manage vgrids
7
- # Copyright (C) 2003-2024 The MiG Project lead by Brian Vinter
7
+ # Copyright (C) 2003-2025 The MiG Project lead by the Science HPC Center at UCPH
8
8
#
9
9
# This file is part of MiG.
10
10
#
@@ -64,6 +64,7 @@ def main(client_id, user_arguments_dict):
64
64
defaults = signature ()[1 ]
65
65
title_entry = find_entry (output_objects , 'title' )
66
66
label = "%s" % configuration .site_vgrid_label
67
+ support_email = "%s" % configuration .support_email
67
68
title_entry ['text' ] = "%s Management" % label
68
69
(validate_status , accepted ) = validate_input_and_cert (
69
70
user_arguments_dict ,
@@ -106,6 +107,7 @@ def main(client_id, user_arguments_dict):
106
107
form_method = 'post'
107
108
csrf_limit = get_csrf_limit (configuration )
108
109
fill_helpers = {'vgrid_label' : label ,
110
+ 'support_email' : support_email ,
109
111
'form_method' : form_method ,
110
112
'csrf_field' : csrf_field ,
111
113
'csrf_limit' : csrf_limit }
@@ -488,11 +490,11 @@ def main(client_id, user_arguments_dict):
488
490
if operation in show_operations :
489
491
user_map = get_full_user_map (configuration )
490
492
user_dict = user_map .get (client_id , None )
493
+ output_objects .append ({'object_type' : 'sectionheader' , 'text' :
494
+ 'Additional %ss' % label })
495
+
491
496
# Optional limitation of create vgrid permission
492
497
if user_dict and vgrid_create_allowed (configuration , user_dict ):
493
- output_objects .append ({'object_type' : 'sectionheader' , 'text' :
494
- 'Additional %ss' % label })
495
-
496
498
output_objects .append (
497
499
{'object_type' : 'text' , 'text' :
498
500
'''Please enter a name for the new %(vgrid_label)s to add,
@@ -515,6 +517,15 @@ def main(client_id, user_arguments_dict):
515
517
<input type="submit" value="Create %(vgrid_label)s" />
516
518
</form>
517
519
''' % fill_helpers })
520
+ else :
521
+ output_objects .append (
522
+ {'object_type' : 'warning' , 'text' :
523
+ """You don't have permission to create %(vgrid_label)ss on
524
+ this site.""" % fill_helpers })
525
+ output_objects .append (
526
+ {'object_type' : 'text' , 'text' :
527
+ """Please contact support at %(support_email)s if you think
528
+ that you qualify for it.""" % fill_helpers })
518
529
519
530
output_objects .append ({'object_type' : 'sectionheader' , 'text' :
520
531
'Request Access to %ss' % label })
0 commit comments