Commit 017f97c7 authored by Marc Duez's avatar Marc Duez
Browse files

server : config index > display only authorized config

parent 6f50dfe8
...@@ -11,10 +11,11 @@ def index(): ...@@ -11,10 +11,11 @@ def index():
return gluon.contrib.simplejson.dumps(res, separators=(',',':')) return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
query = db(db.config).select() query = db((auth.accessible_query('read', db.config) | auth.accessible_query('admin', db.config) ) ).select()
return dict(message=T('config_list'), return dict(message=T('config_list'),
query=query) query=query,
isAdmin = auth.has_membership("admin"))
def add(): def add():
......
...@@ -13,20 +13,22 @@ ...@@ -13,20 +13,22 @@
<td class="column1"> program </td> <td class="column1"> program </td>
<td class="column2"> command </td> <td class="column2"> command </td>
<td> info </td> <td> info </td>
<td class="column5"> </td>
<td class="column5"> </td> <td class="column5"> </td>
<td class="column5"> </td> <td class="column5"> </td>
</tr> </tr>
</thead> </thead>
{{ {{
query = None
c_id = "" c_id = ""
query = db(db.config).select()
for row in query :}} for row in query :}}
<tr> <tr>
<td> {{=row.name }} </td> <td> {{=row.name }} </td>
<td> {{=row.program }} </td> <td> {{=row.program }} </td>
<td> {{=row.command }} </td> <td> {{=row.command }} </td>
<td> {{=row.info }} </td> <td> {{=row.info }} </td>
{{if isAdmin:}} <td onclick="db.call('config/permission', {'id' :'{{=row.id}}'} )" > p </td> {{else:}} <td></td> {{pass}}
<td onclick="db.call('config/edit', {'id' :'{{=row.id}}'} )" > e </td> <td onclick="db.call('config/edit', {'id' :'{{=row.id}}'} )" > e </td>
<td onclick="db.call('config/confirm', {'id' :'{{=row.id}}'} )" > X </td> <td onclick="db.call('config/confirm', {'id' :'{{=row.id}}'} )" > X </td>
</tr> </tr>
......
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