Commit 7c3819e3 authored by Vidjil Team's avatar Vidjil Team

controllers/group.py, group/index.html: display permissions in group list

parent 6dace449
......@@ -14,6 +14,14 @@ def index():
for row in query:
row.parents = ', '.join(str(value) for value in auth.get_group_parent(row.auth_group.id))
row.access = ''
if auth.has_permission(PermissionEnum.create.value, 'sample_set', group_id=row.auth_group.id): row.access += 'c'
if auth.has_permission(PermissionEnum.upload.value, 'sample_set', group_id=row.auth_group.id): row.access += 'u'
if auth.has_permission(PermissionEnum.run.value, 'sample_set', group_id=row.auth_group.id): row.access += 'r'
if auth.has_permission(PermissionEnum.anon.value, 'sample_set', group_id=row.auth_group.id): row.access += 'a'
if auth.has_permission(PermissionEnum.admin.value, 'sample_set', group_id=row.auth_group.id): row.access += 'e'
if auth.has_permission(PermissionEnum.save.value, 'sample_set', group_id=row.auth_group.id): row.access += 's'
return dict(message=T('Groups'), query=query, count=count)
## return an html form to add a group
......
......@@ -20,7 +20,7 @@
<tr onclick="db.call('group/info', {'id' :'{{=row.auth_group.id}}'} )">
<td> {{=row.auth_group.role}} </td>
<td> {{=row[count]}} </td>
<td> {{=row.auth_group.description }} </td>
<td> {{=row.access}} // {{=row.auth_group.description }} </td>
<td> {{=row.parents}} </td>
<td onclick="db.call('group/permission', {'id' :'{{=row.auth_group.id}}'} )" > <i class="icon-key" title="set permissions"></i> </td>
<td onclick="db.call('group/confirm', {'id' :'{{=row.auth_group.id}}'} )" > <i class="icon-erase" title="delete group"></i> </td>
......
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