CleanupTemp n'existe plus.
[GroupUserFolder.git] / dtml / GRUF_audit.zpt
1 <h1 tal:define="global print request/pp | nothing"></h1>
2 <h1 tal:replace="structure here/manage_page_header">Header</h1>
3 <h2 tal:condition="not: print" tal:define="manage_tabs_message options/manage_tabs_message | nothing"
4 tal:replace="structure here/manage_tabs">Tabs</h2>
5
6
7 <div tal:condition="request/doIt | nothing">
8 <h4>Audit results</h4>
9
10 <table
11 border="1"
12 class="list-item"
13 tal:define="
14 global users_and_roles here/listUsersAndRoles;
15 site_tree here/getSiteTree;
16 table_cache python:here.computeSecuritySettings(site_tree, users_and_roles, [('R', request.read_permission), ('W', request.write_permission)]);
17 "
18 tal:condition="users_and_roles"
19 >
20 <tr tal:define="width python:int(100/len(users_and_roles))">
21 <td width="0" tal:attributes="width string:$width%"></td>
22 <td width="0" align="center"
23 tal:repeat="s users_and_roles"
24 tal:attributes="width string:$width%"
25 >
26 <span tal:define="color python:test(s[0] == 'user', here.user_color, test(s[0] == 'group', here.group_color, here.role_color))">
27 <font color="" tal:attributes="color color">
28 <tal:block tal:condition="not:request/use_legend|nothing">
29 <b tal:content="structure python:s[4]" /><br />
30 </tal:block>
31 <tal:block tal:condition="request/use_legend|nothing">
32 <b tal:content="python:s[3]" />
33 </tal:block>
34 </font>
35 <span tal:condition="not:request/use_legend|nothing">
36 (<font color="" tal:attributes="color color"><span tal:replace="python:s[0]" /></font>)
37 </span>
38 </span>
39 </td>
40 </tr>
41
42 <tr tal:repeat="folder site_tree">
43 <td nowrap="1">
44 <span tal:repeat="x python:range(0,folder[1])" tal:omit-tag="">-</span>
45 <a href=""
46 tal:attributes="href python:folder[2]"
47 tal:content="python:folder[0]"
48 />
49 <tal:block
50 tal:define="state python:here.portal_workflow.getInfoFor(here.restrictedTraverse(folder[2]), 'review_state')"
51 tal:on-error="nothing"
52 >
53 <br />
54 <span tal:repeat="x python:range(0,folder[1])" tal:omit-tag="">-</span>
55 <span tal:replace="state" />
56 </tal:block>
57 </td>
58 <td
59 tal:repeat="s users_and_roles"
60 >
61 <tal:block
62 tal:define="
63 R python:table_cache[folder[2]][s[:2]].get('R', None);
64 W python:table_cache[folder[2]][s[:2]].get('W', None)"
65 >
66 <span tal:condition="R">R</span>
67 <span tal:condition="W">W</span>
68 <span tal:condition="python: (not R) and (not W)">&nbsp;</span>
69 </tal:block>
70 </td>
71 </tr>
72 </table>
73 </div>
74
75 <div tal:condition="request/use_legend|nothing">
76 <h4>Legend</h4>
77 <ol>
78 <table>
79 <tr class="list-header">
80 <th class="list-header">Id</th>
81 <th class="list-header">Label</th>
82 <th class="list-header">Kind</th>
83 </tr>
84
85 <tr tal:repeat="actor users_and_roles">
86 <span tal:define="color python:test(actor[0] == 'user', here.user_color, test(actor[0] == 'group', here.group_color, here.role_color))">
87 <td class="list-item"><font color="" tal:attributes="color color" tal:content="python:actor[3]">Id</font></td>
88 <td class="list-item"><font color="" tal:attributes="color color" tal:content="structure python:actor[4]">Label</font></td>
89 <td class="list-item"><font color="" tal:attributes="color color" tal:content="python:actor[0]">Kind</font></td>
90 </span>
91 </tr>
92
93 </table>
94 </ol>
95 </div>
96
97 <div tal:condition="not: print" tal:omit-tag="">
98 <h4>Audit settings</h4>
99 <ol>
100 <p>
101 See help below if you do not understand those settings.
102 </p>
103
104 <form action="manage_audit" method="GET">
105 <input type="hidden" name="doIt" value="1">
106 <table
107 tal:define="default here/getDefaultPermissions"
108 >
109 <tr class="list-header">
110 <th>Parameter</th>
111 <th class="list-header">Setting</th>
112 </tr>
113 <tr>
114 <td><div class="list-item">Read permission</div></td>
115 <td>
116 <select name="read_permission" size="1">
117 <option
118 selected=0
119 value=""
120 tal:repeat="perm here/listAuditPermissions"
121 tal:attributes="
122 value perm;
123 selected python:perm == default['R'];
124 "
125 tal:content="perm"
126 />
127 </select>
128 </td>
129 </tr>
130 <tr>
131 <td><div class="list-item">Write permission</div></td>
132 <td>
133 <select name="write_permission" size="1">
134 <option
135 selected=0
136 value=""
137 tal:repeat="perm here/listAuditPermissions"
138 tal:attributes="
139 value perm;
140 selected python:perm == default['W'];
141 "
142 tal:content="perm"
143 />
144 </select>
145 </td>
146 </tr>
147 <tr>
148 <td><div class="list-item">Displayed actors</div></td>
149 <td>
150 <div class="list-item">
151 <input type="checkbox" name="display_roles" checked="" tal:attributes="checked request/display_roles|python:test(request.get('doIt',None), 0, 1)">
152 <font color="" tal:attributes="color here/role_color">Roles</font><br />
153 <input type="checkbox" name="display_groups" checked="" tal:attributes="checked request/display_groups|python:test(request.get('doIt',None), 0, 1)">
154 <font color="" tal:attributes="color here/group_color">Groups</font><br />
155 <input type="checkbox" name="display_users" checked="" tal:attributes="checked request/display_users|python:test(request.get('doIt',None), 0, 0)">
156 <font color="" tal:attributes="color here/user_color">Users</font>
157 </div>
158 </td>
159 </tr>
160 <tr>
161 <td valign="top"><div class="list-item">Use a legend</div></td>
162 <td>
163 <div class="list-item">
164 <input type="checkbox" name="use_legend" checked="" tal:attributes="checked request/use_legend|nothing">
165 (Use this feature to display actors names outside the table. This will reduce the table width, which may be useful for printing, for example.)
166 </div>
167 </td>
168 </tr>
169 <tr>
170 <td><div class="list-item">Printable page</div></td>
171 <td>
172 <div class="list-item">
173 <input type="checkbox" name="pp" checked="" tal:attributes="checked request/pp|nothing">
174 </div>
175 </td>
176 </tr>
177 <tr>
178 <td></td>
179 <td><input type="submit" value="View"></td>
180 </tr>
181 </table>
182 </form>
183 </ol>
184 </div>
185
186
187 <div tal:condition="not: print" tal:omit-tag="">
188 <div tal:condition="not:request/doIt | nothing">
189
190 <h4>About the audit table</h4>
191 <ol>
192 <p>
193 This management tab allows one to check how the site security is applied for the most useful cases.<br />
194 This allows you to have a precise abstract of the security settings for a little set of permissions as
195 if it simply were "Read" and "Write" permissions.
196 </p>
197
198 <p>
199 <strong>
200 This management tab won't change anything in your security settings. It is just intended to show information and not to modify anything.
201 </strong>
202 </p>
203
204 <p>
205 Select, in the form below, the permissions you want to monitor and the kind of actors (roles, groups or users) you want to display.
206 </p>
207
208 <ol>
209 <h4>Hint</h4>
210 <p>
211 Usually, for a regular Zope site, the
212 permission set would be mapped this way:
213 </p>
214
215 <ul>
216 <li>Read: View</li>
217 <li>Write: Change Images and Files</li>
218 </ul>
219 <p>
220 For a Plone site, the
221 permission set would be mapped this way:
222 </p>
223
224 <ul>
225 <li>Read: View</li>
226 <li>Write: Modify portal content</li>
227 </ul>
228 <p>
229 If you have <strong>a lot of users</strong>, rendering this audit can be very time-consuming.<br />
230 In such conditions, you can select only "roles" to make things a lot faster.
231 </ol>
232 </ol>
233 </div>
234 </div>
235
236 <h1 tal:replace="structure here/manage_page_footer">Footer</h1>