Commit 1c54df8f authored by Ryan Herbert's avatar Ryan Herbert
Browse files

VidjilAuth.py minor optimision can_modify_sample_set

a minor optimisation if a permission is found for the sample_set, return
it.
parent cc96b572
......@@ -288,6 +288,8 @@ class VidjilAuth(Auth):
return False
perm = self.get_permission(PermissionEnum.admin.value, 'sample_set', sample_set_id, user)\
or self.is_admin(user)
if perm:
return True
for row in db( db[sample_type].sample_set_id == sample_set_id ).select() :
if self.can_modify(sample_type, row.id, user):
......
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