Commit 82fdbfc8 authored by marc duez's avatar marc duez

migrator.py : simplify getAccessible request

permission should always be defined on sample_set table, checking permissions on patient/run/generic table is not needed
parent 73e1afaf
Pipeline #175579 failed with stages
in 7 minutes and 50 seconds
......@@ -164,11 +164,9 @@ class GroupExtractor(Extractor):
def getAccessible(self, table, groupids):
db = self.db
rows = db((((db[table].id == db.auth_permission.record_id)
& (db.auth_permission.table_name == table))
| ((db.sample_set.id == db.auth_permission.record_id)
& (db.sample_set.id == db[table].sample_set_id)
& (db.auth_permission.table_name == "sample_set")))
rows = db((db.sample_set.id == db.auth_permission.record_id)
& (db.sample_set.id == db[table].sample_set_id)
& (db.auth_permission.table_name == "sample_set")
& (db.auth_permission.name == PermissionEnum.access.value)
& (db.auth_permission.group_id.belongs(groupids))
).select(db[table].ALL)
......
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