Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit d61e1a7f authored by marc duez's avatar marc duez
Browse files

sample_set.py : display/edit sample_set access permissions instead of...

sample_set.py : display/edit sample_set access permissions instead of patient/run access permissions
parent 10e8e9be
......@@ -1084,7 +1084,7 @@ def permission():
row.perms = ', '.join(map(lambda x: x.name, permissions))
row.parent_access = ', '.join(str(value) for value in auth.get_access_groups(db[stype], request.vars['id'], group=row.id))
row.read = auth.get_group_access(sample_set.sample_type, data.id, row.id)
row.read = auth.get_group_access("sample_set", request.vars["id"] , row.id)
log.info("load permission page for sample_set (%s)" % request.vars["id"],
extra={'user_id': auth.user.id, 'record_id': request.vars['id'], 'table_name': "sample_set"})
......@@ -1102,7 +1102,6 @@ def change_permission():
ssid = request.vars["sample_set_id"]
sample_set = db.sample_set[ssid]
sample_type = sample_set.sample_type
data_id = db(db[sample_type].sample_set_id == ssid).select().first().id
error = ""
if request.vars["group_id"] == "" :
......@@ -1111,14 +1110,14 @@ def change_permission():
error += "missing sample_set_id, "
if error=="":
if auth.get_group_access(sample_type,
data_id,
if auth.get_group_access("sample_set",
ssid,
int(request.vars["group_id"])):
auth.del_permission(request.vars["group_id"], PermissionEnum.access.value, db[sample_type], data_id)
auth.del_permission(request.vars["group_id"], PermissionEnum.access.value, db["sample_set"], ssid)
res = {"message" : "access '%s' deleted to '%s'" % (PermissionEnum.access.value, db.auth_group[request.vars["group_id"]].role)}
else :
auth.add_permission(request.vars["group_id"], PermissionEnum.access.value, db[sample_type], data_id)
auth.add_permission(request.vars["group_id"], PermissionEnum.access.value, db["sample_set"], ssid)
res = {"message" : "access '%s' granted to '%s'" % (PermissionEnum.access.value, db.auth_group[request.vars["group_id"]].role)}
log.info(res, extra={'user_id': auth.user.id, 'record_id': request.vars['sample_set_id'], 'table_name': 'sample_set'})
......
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