aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/oauth2
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-07 15:26:41 -0500
committerFrederick Muriuki Muriithi2024-06-07 15:26:41 -0500
commitebeb75756d53509d2872ac91b2b86942e394ef23 (patch)
treecb9fb20ee0d72b0490d79433c06e80c964abc7b2 /gn2/wqflask/templates/oauth2
parent7bc986a1d4c90a76f508a115f033b5428e5801e4 (diff)
downloadgenenetwork2-ebeb75756d53509d2872ac91b2b86942e394ef23.tar.gz
PoC: Display resource roles on View-Resource page.
Diffstat (limited to 'gn2/wqflask/templates/oauth2')
-rw-r--r--gn2/wqflask/templates/oauth2/view-resource.html56
1 files changed, 52 insertions, 4 deletions
diff --git a/gn2/wqflask/templates/oauth2/view-resource.html b/gn2/wqflask/templates/oauth2/view-resource.html
index 6ae5af56..2d11a302 100644
--- a/gn2/wqflask/templates/oauth2/view-resource.html
+++ b/gn2/wqflask/templates/oauth2/view-resource.html
@@ -231,10 +231,58 @@
<div class="row">
<h3>Available Resource Roles</h3>
- <p class="text-info">
- <span class="glyphicon glyphicon-exclamation-sign text-info"></span>
- The resource roles will go here when they are implemented …
- </p>
+ <table class="table">
+ <caption>Roles Acting on this Resource</caption>
+ <thead>
+ <tr>
+ <th>Role Name</th>
+ <th>Privilege</th>
+ <th>Privilege Description</th>
+ <th colspan="2">Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ {%for role in resource_roles%}
+ {%for priv in role.privileges%}
+ {%if loop.index == 1%}
+ <tr>
+ <td rowspan="{{role.privileges | length}}"
+ style="text-align: center;vertical-align: middle;">
+ {{role.role_name}}
+ </td>
+ <td>{{priv.privilege_id}}</td>
+ <td>{{priv.privilege_description}}</td>
+ <td rowspan="{{role.privileges | length}}"
+ style="text-align: center;vertical-align: middle;">
+ <a href="" class="btn btn-danger"
+ title="Not implemented: Would delete role.">Delete</a>
+ </td>
+ <td rowspan="{{role.privileges | length}}"
+ style="text-align: center;vertical-align: middle;">
+ <a href="" class="btn btn-info"
+ title="Not implemented: Would edit role.">Edit</a>
+ </td>
+ </tr>
+ {%else%}
+ <tr>
+ <td>{{priv.privilege_id}}</td>
+ <td>{{priv.privilege_description}}</td>
+ </tr>
+ {%endif%}
+ {%endfor%}
+ {%else%}
+ <tr>
+ <td colspan="4">
+ <p class="text-info">
+ <span
+ class="glyphicon glyphicon-exclamation-sign text-info"></span>
+ No roles defined for this resource.
+ </p>
+ </td>
+ </tr>
+ {%endfor%}
+ </tbody>
+ </table>
</div>
<div class="row">