Commit cd5bb759 authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files run/add.html owner group

Added owner_group to run so that it is possible to affect a run to any
group the user is a member of. Select box is currently hidden and
selects the user_group by default unless the group Lille is in the list
parent d8a298a8
......@@ -177,10 +177,19 @@ def add():,
if (auth.is_admin()):
groups = db(db.auth_group).select(, db.auth_group.role)
groups = auth.get_user_groups()
master_group = auth.user_group()
for row in groups:
if row.role == 'Lille':
master_group =
return dict(message=T('add run'),
sequencer_list = sequencer_list,
pcr_list = pcr_list)
pcr_list = pcr_list, groups=groups, master_group=master_group)
else :
res = {"message": ACCESS_DENIED}
......@@ -218,11 +227,11 @@ def add_form():
user_group = auth.user_group(
user_group = int(request.vars["run_group"])
admin_group = db(db.auth_group.role=='admin').select().first().id
#patient creator automaticaly has all rights
auth.add_permission(user_group, 'access',, id)
auth.add_permission(user_group, PermissionEnum.access.value,, id)
res = {"redirect": "run/index",
"args" : { "id" : id },
......@@ -18,6 +18,13 @@
<td><input class="date" id="run_date" name="run_date" type="text" value=""><span>(format: yyyy-mm-dd)</span></td>
<tr class='devel-mode'>
<td><label for="run_group" id="run_group__label">Owner Group: </label></td>
{{= SELECT(*[OPTION(g.role, for g in groups], _name="run_group", _value=master_group, value=master_group) }}
<td><label for="run_info" id="run_info__label">Info: </label></td>
<td><textarea class="text" cols="60" id="run_info" name="info" rows="10"></textarea></td>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment