view_permissions.smarty
4.8 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<h2><img src="{if $config->get("ui/morphEnabled") == '1'}{$rootUrl}/skins/kts_{$config->get("ui/morphTo")}/title_bullet.png{else}{$rootUrl}/resources/graphics/title_bullet.png{/if}"/>{i18n}View Permissions for{/i18n}:<br />{$context->oFolder->getName()|sanitize}</h2>
<p class="descriptiveText">{i18n}This page shows the permissions that apply to
this specific folder. Only the roles or groups which have permissions
assigned are shown.{/i18n}</p>
{if $edit}
{i18n}Manage security{/i18n}: <a href="{addQS context=$context}action=edit{/addQS}">{i18n}Edit permissions{/i18n}</a>
| <a href="{addQS context=$context}action=resolved_users{/addQS}">{i18n}View resolved permissions for user{/i18n}</a>
{else}
{i18n}Manage security{/i18n}: <a href="{addQS context=$context}action=resolved_users{/addQS}">{i18n}View resolved permissions for user{/i18n}</a>
{/if}
{if $iFolderId != 1}
<p>
<div class="ktInfoMessage">
{ if $inherited }
<span>{i18n arg_permission_source=$inherited|sanitize}This folder <strong>inherits</strong> its permissions from #permission_source#.{/i18n}
{if $inheritable}
<a class="ktActionLink ktDelete"
kt:deleteMessage="{i18n}Are you sure you wish to override the permissions?{/i18n}"
href="{addQS}action=edit&fFolderId={$oFolder->getId()}&override=1{/addQS}">{i18n}Override permissions{/i18n}</a>
{/if}
</span>
{ else }
<p>{i18n}This folder defines its own permissions.{/i18n}</p>
{ /if }
</div>
</p>
{ /if }
{if (empty($roles) && empty($groups) && empty($users)) }
<div class="ktInfoMessage"><span>{i18n}No roles, groups, or users have been defined or have permissions.{/i18n}</span></div>
{else}
<table class="kt_collection narrow" cellspacing="0" cellpadding="0" border="0">
<thead>
<tr>
<th width="40%">{i18n}Role or Group{/i18n}</th>
{ foreach item=oPerm from=$permissions }
<th title="{$oPerm->getName()}" class="centered">{$oPerm->getHumanName()}</th>
{ /foreach }
</tr>
</thead>
<tbody>
{ foreach item=oRole from=$roles }
<td><span class="descriptiveText">{i18n}Role{/i18n}:</span> {$oRole->getName()}</td>
{ assign var=iRoleId value=$oRole->getId() }
{ foreach item=oPerm from=$permissions }
{ assign var=iPermId value=$oPerm->getId() }
{ assign var=bHasPerm value=$aMapPermissionRole[$iPermId][$iRoleId] }
{ if $bHasPerm }
<td class="centered"><span class="ktAction ktInline ktAllowed">{i18n}Allowed{/i18n}</span></td>
{ else }
<td class="centered"><span class="ktAction ktInline ktDenied">{i18n}Denied{/i18n}</span></td>
{ /if }
{ /foreach }
</tr>
{ /foreach }
{ foreach item=oGroup from=$groups }
<td><span class="descriptiveText">{i18n}Group{/i18n}:</span> {$oGroup->getName()}</td>
{ assign var=iGroupId value=$oGroup->getId() }
{ foreach item=oPerm from=$permissions }
{ assign var=iPermId value=$oPerm->getId() }
{ assign var=bHasPerm value=$aMapPermissionGroup[$iPermId][$iGroupId] }
{ if $bHasPerm }
<td class="centered"><span class="ktAction ktInline ktAllowed">{i18n}Allowed{/i18n}</span></td>
{ else }
<td class="centered"><span class="ktAction ktInline ktDenied">{i18n}Denied{/i18n}</span></td>
{ /if }
{ /foreach }
</tr>
{ /foreach }
{ foreach item=oUser from=$users }
<tr>
<td><span class="descriptiveText">{i18n}User: {/i18n}</span> {$oUser->getName()}</td>
{ assign var=iUserId value=$oUser->getId() }
{ foreach item=oPerm from=$permissions }
{ assign var=iPermId value=$oPerm->getId() }
{ assign var=bHasPerm value=$aMapPermissionUser[$iPermId][$iUserId] }
{ if $edit}
{ if $bHasPerm }
<td class="centered"><input type="checkbox" name="foo[{$iPermId}][group][]"
value="{$iGroupId}" checked="true"></td>
{ else }
<td class="centered"><input type="checkbox" name="foo[{$iPermId}][group][]"
value="{$iGroupId}"></td>
{ /if }
{else}
{ if $bHasPerm }
<td class="centered"><span class="ktAction ktInline ktAllowed">{i18n}Allowed{/i18n}</span></td>
{ else }
<td class="centered"><span class="ktAction ktInline ktDenied">{i18n}Denied{/i18n}</span></td>
{ /if }
{/if}
{ /foreach }
</tr>
{ /foreach }
</tbody>
</table>
{ /if }
{ if (!empty($conditions)) }
<h3>{i18n}Dynamic Conditions{/i18n}</h3>
<table class="kt_collection" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th class="title">{i18n}Group{/i18n}</th>
<th class="title">{i18n}Condition{/i18n}</th>
{foreach from=$permissions item=oPerm}
<th class="title" title="{$oPerm->getName()}" class="centered">{$oPerm->getHumanName()}</th>
{/foreach}
</tr>
</thead>
<tbody>
{foreach from=$conditions item=aInfo}
<tr>
<td>{$aInfo.group}</td>
<td>{$aInfo.name}</td>
{foreach from=$permissions item=oPerm}
{assign var=perm_id value=$oPerm->getId()}
{ if $aInfo.perms.$perm_id }
<td class="centered"><span class="ktAction ktInline ktAllowed">{i18n}Allowed{/i18n}</span></td>
{ else }
<td class="centered"><span class="ktAction ktInline ktDenied">{i18n}Denied{/i18n}</span></td>
{ /if }
{/foreach}
</tr>
{/foreach}
</tbody>
</table>
{/if}