Commit 01de801b authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team
Browse files

controllers/user.py, views/user: access and groups in the user table

parent 73c1a24a
......@@ -12,6 +12,15 @@ def index():
for row in query :
row.created = db( db.patient.creator == row.id ).count()
row.access = ''
if auth.has_permission('create', 'patient', 0, row.id): row.access += 'c'
if auth.has_permission('upload', 'sequence_file', 0, row.id): row.access += 'u'
if auth.has_permission('run', 'results_file', 0, row.id): row.access += 'r'
q = [g.group_id for g in db(db.auth_membership.user_id==row.id).select()]
q.sort()
row.groups = ' '.join([str(g) for g in q])
row.size = 0
row.files = 0
query_size = db( db.sequence_file.provider == row.id ).select()
......
......@@ -7,11 +7,13 @@
<div id="db_table_container">
<table class="db_table" id="table">
<thead>
<tr><td class="column_100">id</td>
<tr><td class="column_50">id</td>
<td class="column_200"> name</td>
<td> @</td>
<td class="colum1">patients created </td>
<td class="colum1">files uploaded </td>
<td class="column_200"> @</td>
<td class="column_50">access</td>
<td class="column_100">groups</td>
<td class="column_50">patients created </td>
<td class="column_100">files uploaded </td>
</tr>
</thead>
......@@ -20,6 +22,8 @@
<td> {{=row.id}}</td>
<td> {{=row.first_name}} {{=row.last_name}}</td>
<td> {{=row.email}} </td>
<td> {{=row.access}} </td>
<td> {{=row.groups}} </td>
<td> {{=row.created}} </td>
<td> {{=row.files}} ({{=vidjil_utils.format_size(row.size)}}) </td>
</tr>
......
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