Commit d926e405 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge remote-tracking branch 'origin/prod-server' into dev

parents 23c71763 7b77dd1a
Pipeline #21440 failed with stages
in 6 minutes and 21 seconds
......@@ -23,19 +23,18 @@ def next_sample_set():
if 'next' in request.vars:
try:
sample_type = db.sample_set[request.vars["id"]].sample_type
for row in db( db[sample_type].sample_set_id == request.vars["id"] ).select() :
current_id = row.id
sample_set_id = int(request.vars['id'])
go_next = int(request.vars['next'])
same_type_with_permissions = (db.sample_set.sample_type == sample_type) & (auth.vidjil_accessible_query(PermissionEnum.read.value, db.sample_set))
if go_next > 0:
res = db((db[sample_type].id > current_id) & (auth.vidjil_accessible_query(PermissionEnum.read.value, db[sample_type]))).select(
db[sample_type].id, db[sample_type].sample_set_id, orderby=db[sample_type].id, limitby=(0,1))
res = db((db.sample_set.id > sample_set_id) & (same_type_with_permissions)).select(
db.sample_set.id, orderby=db.sample_set.id, limitby=(0,1))
else:
res = db((db[sample_type].id < current_id) & (auth.vidjil_accessible_query(PermissionEnum.read.value, db[sample_type]))).select(
db[sample_type].id, db[sample_type].sample_set_id, orderby=~db[sample_type].id, limitby=(0,1))
res = db((db.sample_set.id < sample_set_id) & (same_type_with_permissions)).select(
db.sample_set.id, orderby=~db.sample_set.id, limitby=(0,1))
if (len(res) > 0):
request.vars["id"] = str(res[0].sample_set_id)
request.vars["id"] = str(res[0].id)
except:
pass
......
......@@ -51,7 +51,7 @@ class SampleSetList():
self.elements[key.id].most_used_conf = ""
self.elements[key.id].groups = ""
self.elements[key.id].group_list = []
self.elements[key.id].has_permission = auth.can_modify(type, key.id)
self.elements[key.id].has_permission = auth.can_modify_sample_set(key.sample_set_id)
self.elements[key.id].anon_allowed = auth.can_view_info(type, key.id)
self.element_ids = self.elements.keys()
......
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