Commit c8cc6f8f authored by Ryan Herbert's avatar Ryan Herbert
Browse files

user_group.py, sample_set.py, SampleSet.py use current to get auth

instead of passing auth as a parameter, it can be retrieved using
current
parent 1b943c1a
......@@ -178,7 +178,7 @@ def all():
list.load_creator_names()
list.load_sample_information()
list.load_config_information()
if isAdmin or len(get_group_list(auth)) > 1:
if isAdmin or len(get_group_list()) > 1:
list.load_permitted_groups()
list.load_anon_permissions()
result = list.get_values()
......
......@@ -63,7 +63,7 @@ class SampleSet(object):
fields.append({'name': 'name', 'sort': 'name', 'call': self.get_name, 'width': 200, 'public': True})
fields.append({'name': 'info', 'sort': 'info', 'call': self.get_tagged_info, 'width': None, 'public': True})
fields.append({'name': 'results', 'sort': 'confs', 'call': self.get_config_urls, 'width': None, 'public': True})
if auth.is_admin() or len(get_group_list(auth)) > 1:
if auth.is_admin() or len(get_group_list()) > 1:
fields.append({'name': 'groups', 'sort': 'groups', 'call': self.get_groups_string, 'width': 100, 'public': True})
fields.append({'name': 'creator', 'sort': 'creator', 'call': self.get_creator, 'width': 100, 'public': True})
fields.append({'name': 'files', 'sort': 'file_count', 'call': self.get_files, 'width': 100, 'public': True})
......
from gluon import current
def get_group_list(auth):
def get_group_list():
auth = current.auth
if (auth.is_admin()):
return db(db.auth_group).select(db.auth_group.id, db.auth_group.role)
else:
......@@ -14,7 +15,7 @@ def get_default_creation_group(auth):
max_group = auth.user_group()
group_dict = {}
max_elements = 0
group_list = get_group_list(auth)
group_list = get_group_list()
for group in group_list:
if (auth.is_admin()
or auth.has_permission(PermissionEnum.create.value, 'sample_set', 0, group_id = group.id)):
......
Supports Markdown
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