| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 3 |
<xsl:template name="entityAccessForm"> |
|---|
| 4 |
<xsl:param name="type"/><!-- optional: currently used for inbox and outbox to conditionally display scheduling access --> |
|---|
| 5 |
<xsl:param name="acl"/><!-- required: nodeset of entity acls used to initialize javascript object. --> |
|---|
| 6 |
<xsl:param name="outputId"/><!-- required: id of the current access block display to update --> |
|---|
| 7 |
|
|---|
| 8 |
<table cellpadding="0" id="accessFormTable" class="common"> |
|---|
| 9 |
<tr> |
|---|
| 10 |
<th colspan="2" class="commonHeader">Add:</th> |
|---|
| 11 |
</tr> |
|---|
| 12 |
<tr> |
|---|
| 13 |
<td> |
|---|
| 14 |
<h5>Who:</h5> |
|---|
| 15 |
<div class="whoTypes"> |
|---|
| 16 |
<input type="text" name="who" size="20"/><br/> |
|---|
| 17 |
<input type="radio" value="user" name="whoType" checked="checked"/> user |
|---|
| 18 |
<input type="radio" value="group" name="whoType"/> group |
|---|
| 19 |
<p>OR</p> |
|---|
| 20 |
<p> |
|---|
| 21 |
<input type="radio" value="owner" name="whoType"/> owner<br/> |
|---|
| 22 |
<input type="radio" value="auth" name="whoType"/> authenticated<br/> |
|---|
| 23 |
<input type="radio" value="unauth" name="whoType"/> unauthenticated<br/> |
|---|
| 24 |
<input type="radio" value="all" name="whoType"/> all users |
|---|
| 25 |
</p> |
|---|
| 26 |
<input type="button" name="updateACLs" value="add entry" onclick="bwAcl.update(this.form,'{$outputId}')"/> |
|---|
| 27 |
</div> |
|---|
| 28 |
</td> |
|---|
| 29 |
<td> |
|---|
| 30 |
<h5> |
|---|
| 31 |
<span id="accessRightsToggle"> |
|---|
| 32 |
<xsl:choose> |
|---|
| 33 |
<xsl:when test="/bedework/appvar[key='accessRightsToggle']/value='advanced'"> |
|---|
| 34 |
<input type="radio" name="setappvar" value="accessRightsToggle(basic)" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/>basic |
|---|
| 35 |
<input type="radio" name="setappvar" value="accessRightsToggle(advanced)" checked="checked" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/>advanced |
|---|
| 36 |
</xsl:when> |
|---|
| 37 |
<xsl:otherwise> |
|---|
| 38 |
<input type="radio" name="setappvar" value="accessRightsToggle(basic)" checked="checked" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/>basic |
|---|
| 39 |
<input type="radio" name="setappvar" value="accessRightsToggle(advanced)" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/>advanced |
|---|
| 40 |
</xsl:otherwise> |
|---|
| 41 |
</xsl:choose> |
|---|
| 42 |
</span> |
|---|
| 43 |
Rights: |
|---|
| 44 |
</h5> |
|---|
| 45 |
<input type="hidden" name="how" value="" id="bwCurrentHow"/> |
|---|
| 46 |
<!-- field 'acl' will receive xml for method 2 --> |
|---|
| 47 |
<input type="hidden" name="acl" value="" id="bwCurrentAcl" /> |
|---|
| 48 |
<!-- Advanced Access Rights: --> |
|---|
| 49 |
<!-- the "how" field is set by iterating over the howItems below --> |
|---|
| 50 |
<table id="howTable" class="invisible" cellspacing="0"> |
|---|
| 51 |
<xsl:if test="/bedework/appvar[key='accessRightsToggle']/value='advanced'"> |
|---|
| 52 |
<xsl:attribute name="class">visible</xsl:attribute> |
|---|
| 53 |
</xsl:if> |
|---|
| 54 |
<tr> |
|---|
| 55 |
<th>access type</th> |
|---|
| 56 |
<th>allow</th> |
|---|
| 57 |
<th>deny</th> |
|---|
| 58 |
</tr> |
|---|
| 59 |
<tr> |
|---|
| 60 |
<td class="level1"> |
|---|
| 61 |
<input type="checkbox" value="A" id="accessAll" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/>All |
|---|
| 62 |
</td> |
|---|
| 63 |
<td> |
|---|
| 64 |
<input type="radio" value="A" name="accessAll" checked="checked" disabled="disabled"/> |
|---|
| 65 |
</td> |
|---|
| 66 |
<td> |
|---|
| 67 |
<input type="radio" value="-A" name="accessAll" disabled="disabled"/> |
|---|
| 68 |
</td> |
|---|
| 69 |
</tr> |
|---|
| 70 |
<tr> |
|---|
| 71 |
<td class="level2"> |
|---|
| 72 |
<input type="checkbox" value="R" id="accessRead" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)" checked="checked"/> Read |
|---|
| 73 |
</td> |
|---|
| 74 |
<td> |
|---|
| 75 |
<input type="radio" value="R" name="accessRead" checked="checked"/> |
|---|
| 76 |
</td> |
|---|
| 77 |
<td> |
|---|
| 78 |
<input type="radio" value="-R" name="accessRead"/> |
|---|
| 79 |
</td> |
|---|
| 80 |
</tr> |
|---|
| 81 |
<tr> |
|---|
| 82 |
<td class="level3"> |
|---|
| 83 |
<input type="checkbox" value="r" id="r" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read ACL |
|---|
| 84 |
</td> |
|---|
| 85 |
<td> |
|---|
| 86 |
<input type="radio" value="r" name="r" checked="checked" disabled="disabled"/> |
|---|
| 87 |
</td> |
|---|
| 88 |
<td> |
|---|
| 89 |
<input type="radio" value="-r" name="r" disabled="disabled"/> |
|---|
| 90 |
</td> |
|---|
| 91 |
</tr> |
|---|
| 92 |
<tr> |
|---|
| 93 |
<td class="level3"> |
|---|
| 94 |
<input type="checkbox" value="P" id="accessPriv" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read current user privilege set |
|---|
| 95 |
</td> |
|---|
| 96 |
<td> |
|---|
| 97 |
<input type="radio" value="P" name="accessPriv" checked="checked" disabled="disabled"/> |
|---|
| 98 |
</td> |
|---|
| 99 |
<td> |
|---|
| 100 |
<input type="radio" value="-P" name="accessPriv" disabled="disabled"/> |
|---|
| 101 |
</td> |
|---|
| 102 |
</tr> |
|---|
| 103 |
<tr> |
|---|
| 104 |
<td class="level3"> |
|---|
| 105 |
<input type="checkbox" value="F" id="F" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read freebusy |
|---|
| 106 |
</td> |
|---|
| 107 |
<td> |
|---|
| 108 |
<input type="radio" value="F" name="F" checked="checked" disabled="disabled"/> |
|---|
| 109 |
</td> |
|---|
| 110 |
<td> |
|---|
| 111 |
<input type="radio" value="-F" name="F" disabled="disabled"/> |
|---|
| 112 |
</td> |
|---|
| 113 |
</tr> |
|---|
| 114 |
<tr> |
|---|
| 115 |
<td class="level2"> |
|---|
| 116 |
<input type="checkbox" value="W" id="W" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> Write |
|---|
| 117 |
</td> |
|---|
| 118 |
<td> |
|---|
| 119 |
<input type="radio" value="W" name="W" checked="checked" disabled="disabled"/> |
|---|
| 120 |
</td> |
|---|
| 121 |
<td> |
|---|
| 122 |
<input type="radio" value="-W" name="W" disabled="disabled"/> |
|---|
| 123 |
</td> |
|---|
| 124 |
</tr> |
|---|
| 125 |
<tr> |
|---|
| 126 |
<td class="level3"> |
|---|
| 127 |
<input type="checkbox" value="a" id="a" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write ACL |
|---|
| 128 |
</td> |
|---|
| 129 |
<td> |
|---|
| 130 |
<input type="radio" value="a" name="a" checked="checked" disabled="disabled"/> |
|---|
| 131 |
</td> |
|---|
| 132 |
<td> |
|---|
| 133 |
<input type="radio" value="-a" name="a" disabled="disabled"/> |
|---|
| 134 |
</td> |
|---|
| 135 |
</tr> |
|---|
| 136 |
<tr> |
|---|
| 137 |
<td class="level3"> |
|---|
| 138 |
<input type="checkbox" value="p" id="p" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write properties |
|---|
| 139 |
</td> |
|---|
| 140 |
<td> |
|---|
| 141 |
<input type="radio" value="p" name="p" checked="checked" disabled="disabled"/> |
|---|
| 142 |
</td> |
|---|
| 143 |
<td> |
|---|
| 144 |
<input type="radio" value="-p" name="p" disabled="disabled"/> |
|---|
| 145 |
</td> |
|---|
| 146 |
</tr> |
|---|
| 147 |
<tr> |
|---|
| 148 |
<td class="level3"> |
|---|
| 149 |
<input type="checkbox" value="c" id="c" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write content |
|---|
| 150 |
</td> |
|---|
| 151 |
<td> |
|---|
| 152 |
<input type="radio" value="c" name="c" checked="checked" disabled="disabled"/> |
|---|
| 153 |
</td> |
|---|
| 154 |
<td> |
|---|
| 155 |
<input type="radio" value="-c" name="c" disabled="disabled"/> |
|---|
| 156 |
</td> |
|---|
| 157 |
</tr> |
|---|
| 158 |
<tr> |
|---|
| 159 |
<td class="level3"> |
|---|
| 160 |
<input type="checkbox" value="b" id="b" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> create (bind) |
|---|
| 161 |
</td> |
|---|
| 162 |
<td> |
|---|
| 163 |
<input type="radio" value="b" name="b" checked="checked" disabled="disabled"/> |
|---|
| 164 |
</td> |
|---|
| 165 |
<td> |
|---|
| 166 |
<input type="radio" value="-b" name="b" disabled="disabled"/> |
|---|
| 167 |
</td> |
|---|
| 168 |
</tr> |
|---|
| 169 |
<xsl:if test="$type = 'inbox' or $type = 'outbox'"> |
|---|
| 170 |
<tr> |
|---|
| 171 |
<td class="level4"> |
|---|
| 172 |
<input type="checkbox" value="S" id="accessSchedule" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> schedule |
|---|
| 173 |
</td> |
|---|
| 174 |
<td> |
|---|
| 175 |
<input type="radio" value="S" name="accessSchedule" checked="checked" disabled="disabled"/> |
|---|
| 176 |
</td> |
|---|
| 177 |
<td> |
|---|
| 178 |
<input type="radio" value="-S" name="accessSchedule" disabled="disabled"/> |
|---|
| 179 |
</td> |
|---|
| 180 |
</tr> |
|---|
| 181 |
<tr> |
|---|
| 182 |
<td class="level5"> |
|---|
| 183 |
<input type="checkbox" value="t" id="t" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule request |
|---|
| 184 |
</td> |
|---|
| 185 |
<td> |
|---|
| 186 |
<input type="radio" value="t" name="t" checked="checked" disabled="disabled"/> |
|---|
| 187 |
</td> |
|---|
| 188 |
<td> |
|---|
| 189 |
<input type="radio" value="-t" name="t" disabled="disabled"/> |
|---|
| 190 |
</td> |
|---|
| 191 |
</tr> |
|---|
| 192 |
<tr> |
|---|
| 193 |
<td class="level5"> |
|---|
| 194 |
<input type="checkbox" value="y" id="y" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule reply |
|---|
| 195 |
</td> |
|---|
| 196 |
<td> |
|---|
| 197 |
<input type="radio" value="y" name="y" checked="checked" disabled="disabled"/> |
|---|
| 198 |
</td> |
|---|
| 199 |
<td> |
|---|
| 200 |
<input type="radio" value="-y" name="y" disabled="disabled"/> |
|---|
| 201 |
</td> |
|---|
| 202 |
</tr> |
|---|
| 203 |
<tr> |
|---|
| 204 |
<td class="level5"> |
|---|
| 205 |
<input type="checkbox" value="s" id="s" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule free-busy |
|---|
| 206 |
</td> |
|---|
| 207 |
<td> |
|---|
| 208 |
<input type="radio" value="s" name="s" checked="checked" disabled="disabled"/> |
|---|
| 209 |
</td> |
|---|
| 210 |
<td> |
|---|
| 211 |
<input type="radio" value="-s" name="s" disabled="disabled"/> |
|---|
| 212 |
</td> |
|---|
| 213 |
</tr> |
|---|
| 214 |
</xsl:if> |
|---|
| 215 |
<tr> |
|---|
| 216 |
<td class="level3"> |
|---|
| 217 |
<input type="checkbox" value="u" id="u" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> delete (unbind) |
|---|
| 218 |
</td> |
|---|
| 219 |
<td> |
|---|
| 220 |
<input type="radio" value="u" name="u" checked="checked" disabled="disabled"/> |
|---|
| 221 |
</td> |
|---|
| 222 |
<td> |
|---|
| 223 |
<input type="radio" value="-u" name="u" disabled="disabled"/> |
|---|
| 224 |
</td> |
|---|
| 225 |
</tr> |
|---|
| 226 |
<!--<tr> |
|---|
| 227 |
<td class="level1"> |
|---|
| 228 |
<input type="checkbox" value="N" name="howItem" onclick="setupAccessForm(this, this.form)"/> None |
|---|
| 229 |
</td> |
|---|
| 230 |
<td> |
|---|
| 231 |
</td> |
|---|
| 232 |
<td> |
|---|
| 233 |
</td> |
|---|
| 234 |
</tr>--> |
|---|
| 235 |
</table> |
|---|
| 236 |
<!-- Simple Access Rights: --> |
|---|
| 237 |
<!-- the "how" field is set by getting the selected basicHowItem --> |
|---|
| 238 |
<ul id="howList"> |
|---|
| 239 |
<xsl:if test="/bedework/appvar[key='accessRightsToggle']/value='advanced'"> |
|---|
| 240 |
<xsl:attribute name="class">invisible</xsl:attribute> |
|---|
| 241 |
</xsl:if> |
|---|
| 242 |
<li> |
|---|
| 243 |
<input type="radio" value="A" name="basicHowItem"/>All |
|---|
| 244 |
</li> |
|---|
| 245 |
<li> |
|---|
| 246 |
<input type="radio" value="R" name="basicHowItem" checked="checked"/>Read only |
|---|
| 247 |
</li> |
|---|
| 248 |
</ul> |
|---|
| 249 |
</td> |
|---|
| 250 |
</tr> |
|---|
| 251 |
</table> |
|---|
| 252 |
</xsl:template> |
|---|
| 253 |
|
|---|
| 254 |
</xsl:stylesheet> |
|---|