aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/templates/oauth2/list_roles.html
blob: bd2a9c7519c613147ab51bef4b445c996b60079a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{% extends "index_page.html" %}
{%from "oauth2/profile_nav.html" import profile_nav%}
{%from "oauth2/display_error.html" import display_error%}
{%block title%}View User{%endblock%}
{%block content%}
<div class="container" style="min-width: 1250px;">
  {{profile_nav("roles", user_privileges)}}
  <h3>Roles</h3>

  {{flash_me()}}

  <div class="container-fluid">
    <div class="row">
      <h3>Your System-Level Roles</h3>
      <ul>
	{%for role in roles %}
	<li>
	  <a href="{{url_for('oauth2.role.role', role_id=role.role_id)}}"
	     title="Link to role {{role.role_name}}">{{role.role_name}}</a>
	</li>
	{%else%}
	<li>
	  <span class="glyphicon glyphicon-warning-sign"></span>&nbsp;
	  <span class="text-warning">No roles attached to this user</span>
	</li>
	{%endfor%}
      </ul>
    </div>

    <div class="row">
      <h3>Group-Wide Roles</h3>

      {%if "group:role:create-role" in user_privileges%}
      <a href="{{url_for('oauth2.role.create_role')}}"
	 title="Link to create a new group role"
	 class="btn btn-info">New Group Role</a>
      {%endif%}

      {%if group_roles_error is defined%}
      {{display_error("Group Roles", group_role_error)}}
      {%else%}
      <table class="table">
	<caption>Group Roles</caption>
	<thead>
	  <tr>
	    <th>Role Name</th>
	    <th colspan="100%">Actions</th>
	  </tr>
	</thead>
	<tbody>
	  {%for grole in group_roles%}
	  <tr>
	    <td>{{grole.role.role_name}}</td>
	    <td>
	      <a href="{{url_for('oauth2.group.group_role', group_role_id=grole.group_role_id)}}"
		 title="Link to role {{grole.role.role_name}}"
		 class="btn btn-info">
		View
	      </a>
	    </td>
	  </tr>
	  {%else%}
	  <tr>
	    <td colspan="3">
	      <span class="glyphicon glyphicon-exclamation-sign text-info">
	      </span>
	      &nbsp;
	      <span class="text-info">No group roles found</span>
	    </td>
	  </tr>
	  {%endfor%}
	</tbody>
      </table>
      {%endif%}
    </div>

  </div>

</div>
{%endblock%}