Child: [14bbc5] (diff)

Download this file

project_admin_index.html    98 lines (92 with data), 3.5 kB

 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<xi:include href="lib.html" />
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title>Project Admin for $c.project._id</title>
</head>
<body>
<h1>ProjectAdmin for ${project_links(c.project)}</h1>
<div>
<h2>Project ACL Admin</h2>
<p>The project ACL determines project-level permissions.</p>
<div py:for="permission, users in c.project.acl.iteritems()"
style="border:1px solid black">
<h3>Permission: $permission</h3>
<ul>
<li py:for="u in h.make_users(users)">
$u.display_name
<form
py:if="c.user != u or permission != 'security'"
method="post"
action="del_perm"
style="display:inline">
<input type="hidden" name="permission" value="$permission"/>
<input type="hidden" name="user" value="${u._id.url_encode()}"/>
<input type="submit" value="Remove Permission"/>
</form>
</li>
</ul>
<form method="post" action="add_perm">
<input type="hidden" name="permission" value="$permission"/>
User Name: <input type="text" name="username"/>
<input type="submit" value="Add Permission"/>
</form>
</div>
</div>
<div py:if="c.project.is_root">
<h2>Role Admin</h2>
<p>
Each user on the project should have a private role.
Each role can have subroles. A role inherits all the permissions
that its subroles have.
</p>
<div py:for="r in roles" style="border:1px solid black">
<h3>$r._id
<span py:if="r.user_id">($r.user.display_name)</span>
</h3>
<form method="post" action="del_role">
<input type="hidden" name="role" value="$r._id"/>
<input type="submit" value="Remove Role"/>
</form>
<ul>
<li py:for="rr in r.roles">
$rr
<form method="post" action="del_role" style="display:inline">
<input type="hidden" name="role" value="$r._id"/>
<input type="hidden" name="subrole" value="$rr"/>
<input type="submit" value="Remove Role"/>
</form>
</li>
</ul>
<form method="post" action="add_role">
<input type="hidden" name="role" value="$r._id"/>
New role
<select name="subrole">
<option py:for="r in roles" value="$r._id">
$r._id
</option>
</select>
<input type="submit" value="Add"/>
</form>
</div>
<form method="post" action="add_group_role">
<label for="name">New group role</label>
<input type="text" name="name"/>
<input type="submit" value="Add"/>
</form>
<form method="post" action="add_user_role">
<label for="name">New user role</label>
<select name="id">
<option py:for="u in users"
value="${u._id.url_encode()}">$u.display_name</option>
</select>
<input type="submit" value="Add"/>
</form>
</div>
</body>
</html>