| 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="method">1</xsl:param><!-- optional: |
|---|
| 6 |
there are two methods of setting access |
|---|
| 7 |
- method 1, the older method, uses a single request/response per principal |
|---|
| 8 |
- method 2 constructs a javascript object that commits the entire ACL |
|---|
| 9 |
structure in a single request |
|---|
| 10 |
Both methods are currently supported. Method one is used for calendars, |
|---|
| 11 |
method two for setting event access. At some point we may move all access |
|---|
| 12 |
control setting to method two. --> |
|---|
| 13 |
<xsl:param name="acl"/><!-- nodeset of entity acls used to initialize |
|---|
| 14 |
javascript object. Required for method two. --> |
|---|
| 15 |
|
|---|
| 16 |
<table cellpadding="0" id="shareFormTable" class="common"> |
|---|
| 17 |
<tr> |
|---|
| 18 |
<th colspan="2" class="commonHeader"><xsl:value-of select="$util.entityAccessForm.add" /></th> |
|---|
| 19 |
</tr> |
|---|
| 20 |
<tr> |
|---|
| 21 |
<td> |
|---|
| 22 |
<h5><xsl:value-of select="$util.entityAccessForm.who" /></h5> |
|---|
| 23 |
<div class="whoTypes"> |
|---|
| 24 |
<input type="text" name="who" size="20"/><br/> |
|---|
| 25 |
<input type="radio" value="user" name="whoType" checked="checked"/> <xsl:value-of select="$util.entityAccessForm.user" /> |
|---|
| 26 |
<input type="radio" value="group" name="whoType"/> <xsl:value-of select="$util.entityAccessForm.group" /> |
|---|
| 27 |
<p><xsl:value-of select="$util.entityAccessForm.or" /></p> |
|---|
| 28 |
<p> |
|---|
| 29 |
<input type="radio" value="owner" name="whoType"/> <xsl:value-of select="$util.entityAccessForm.owner" /><br/> |
|---|
| 30 |
<input type="radio" value="auth" name="whoType"/> <xsl:value-of select="$util.entityAccessForm.authenticated" /><br/> |
|---|
| 31 |
<input type="radio" value="unauth" name="whoType"/> <xsl:value-of select="$util.entityAccessForm.unauthenticated" /><br/> |
|---|
| 32 |
<input type="radio" value="all" name="whoType"/> <xsl:value-of select="$util.entityAccessForm.all.users" /> |
|---|
| 33 |
</p> |
|---|
| 34 |
</div> |
|---|
| 35 |
</td> |
|---|
| 36 |
<td> |
|---|
| 37 |
<h5> |
|---|
| 38 |
<span id="accessRightsToggle"> |
|---|
| 39 |
<xsl:choose> |
|---|
| 40 |
<xsl:when test="/bedework/appvar[key='accessRightsToggle']/value='advanced'"> |
|---|
| 41 |
<input type="radio" name="setappvar" value="accessRightsToggle(basic)" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/><xsl:value-of select="$util.entityAccessForm.basic" /> |
|---|
| 42 |
<input type="radio" name="setappvar" value="accessRightsToggle(advanced)" checked="checked" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/><xsl:value-of select="$util.entityAccessForm.advanced" /> |
|---|
| 43 |
</xsl:when> |
|---|
| 44 |
<xsl:otherwise> |
|---|
| 45 |
<input type="radio" name="setappvar" value="accessRightsToggle(basic)" checked="checked" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/><xsl:value-of select="$util.entityAccessForm.basic" /> |
|---|
| 46 |
<input type="radio" name="setappvar" value="accessRightsToggle(advanced)" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/><xsl:value-of select="$util.entityAccessForm.advanced" /> |
|---|
| 47 |
</xsl:otherwise> |
|---|
| 48 |
</xsl:choose> |
|---|
| 49 |
</span> |
|---|
| 50 |
<xsl:value-of select="$util.entityAccessForm.rights" /> |
|---|
| 51 |
</h5> |
|---|
| 52 |
<input type="hidden" name="how" value="" id="bwCurrentHow"/> |
|---|
| 53 |
<!-- field 'acl' will receive xml for method 2 --> |
|---|
| 54 |
<input type="hidden" name="acl" value="" id="bwCurrentAcl" /> |
|---|
| 55 |
<!-- Advanced Access Rights: --> |
|---|
| 56 |
<!-- the "how" field is set by iterating over the howItems below --> |
|---|
| 57 |
<table id="howTable" class="invisible" cellspacing="0"> |
|---|
| 58 |
<xsl:if test="/bedework/appvar[key='accessRightsToggle']/value='advanced'"> |
|---|
| 59 |
<xsl:attribute name="class"><xsl:value-of select="$util.entityAccessForm.visible" /></xsl:attribute> |
|---|
| 60 |
</xsl:if> |
|---|
| 61 |
<tr> |
|---|
| 62 |
<th><xsl:value-of select="$util.entityAccessForm.access.type" /></th> |
|---|
| 63 |
<th><xsl:value-of select="$util.entityAccessForm.allow" /></th> |
|---|
| 64 |
<th><xsl:value-of select="$util.entityAccessForm.deny" /></th> |
|---|
| 65 |
</tr> |
|---|
| 66 |
<tr> |
|---|
| 67 |
<td class="level1"> |
|---|
| 68 |
<input type="checkbox" value="A" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/><xsl:value-of select="$util.entityAccessForm.all" /> |
|---|
| 69 |
</td> |
|---|
| 70 |
<td> |
|---|
| 71 |
<input type="radio" value="A" name="A" checked="checked" disabled="disabled"/> |
|---|
| 72 |
</td> |
|---|
| 73 |
<td> |
|---|
| 74 |
<input type="radio" value="-A" name="A" disabled="disabled"/> |
|---|
| 75 |
</td> |
|---|
| 76 |
</tr> |
|---|
| 77 |
<tr> |
|---|
| 78 |
<td class="level2"> |
|---|
| 79 |
<input type="checkbox" value="R" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)" checked="checked"/> <xsl:value-of select="$util.entityAccessForm.read" /> |
|---|
| 80 |
</td> |
|---|
| 81 |
<td> |
|---|
| 82 |
<input type="radio" value="R" name="R" checked="checked"/> |
|---|
| 83 |
</td> |
|---|
| 84 |
<td> |
|---|
| 85 |
<input type="radio" value="-R" name="R"/> |
|---|
| 86 |
</td> |
|---|
| 87 |
</tr> |
|---|
| 88 |
<tr> |
|---|
| 89 |
<td class="level3"> |
|---|
| 90 |
<input type="checkbox" value="r" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.read.acl" /> |
|---|
| 91 |
</td> |
|---|
| 92 |
<td> |
|---|
| 93 |
<input type="radio" value="r" name="r" checked="checked" disabled="disabled"/> |
|---|
| 94 |
</td> |
|---|
| 95 |
<td> |
|---|
| 96 |
<input type="radio" value="-r" name="r" disabled="disabled"/> |
|---|
| 97 |
</td> |
|---|
| 98 |
</tr> |
|---|
| 99 |
<tr> |
|---|
| 100 |
<td class="level3"> |
|---|
| 101 |
<input type="checkbox" value="P" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.read.privilege.set" /> |
|---|
| 102 |
</td> |
|---|
| 103 |
<td> |
|---|
| 104 |
<input type="radio" value="P" name="P" checked="checked" disabled="disabled"/> |
|---|
| 105 |
</td> |
|---|
| 106 |
<td> |
|---|
| 107 |
<input type="radio" value="-P" name="P" disabled="disabled"/> |
|---|
| 108 |
</td> |
|---|
| 109 |
</tr> |
|---|
| 110 |
<tr> |
|---|
| 111 |
<td class="level3"> |
|---|
| 112 |
<input type="checkbox" value="F" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.read.freebusy" /> |
|---|
| 113 |
</td> |
|---|
| 114 |
<td> |
|---|
| 115 |
<input type="radio" value="F" name="F" checked="checked" disabled="disabled"/> |
|---|
| 116 |
</td> |
|---|
| 117 |
<td> |
|---|
| 118 |
<input type="radio" value="-F" name="F" disabled="disabled"/> |
|---|
| 119 |
</td> |
|---|
| 120 |
</tr> |
|---|
| 121 |
<tr> |
|---|
| 122 |
<td class="level2"> |
|---|
| 123 |
<input type="checkbox" value="W" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.write" /> |
|---|
| 124 |
</td> |
|---|
| 125 |
<td> |
|---|
| 126 |
<input type="radio" value="W" name="W" checked="checked" disabled="disabled"/> |
|---|
| 127 |
</td> |
|---|
| 128 |
<td> |
|---|
| 129 |
<input type="radio" value="-W" name="W" disabled="disabled"/> |
|---|
| 130 |
</td> |
|---|
| 131 |
</tr> |
|---|
| 132 |
<tr> |
|---|
| 133 |
<td class="level3"> |
|---|
| 134 |
<input type="checkbox" value="a" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.write.acl" /> |
|---|
| 135 |
</td> |
|---|
| 136 |
<td> |
|---|
| 137 |
<input type="radio" value="a" name="a" checked="checked" disabled="disabled"/> |
|---|
| 138 |
</td> |
|---|
| 139 |
<td> |
|---|
| 140 |
<input type="radio" value="-a" name="a" disabled="disabled"/> |
|---|
| 141 |
</td> |
|---|
| 142 |
</tr> |
|---|
| 143 |
<tr> |
|---|
| 144 |
<td class="level3"> |
|---|
| 145 |
<input type="checkbox" value="p" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.write.prop" /> |
|---|
| 146 |
</td> |
|---|
| 147 |
<td> |
|---|
| 148 |
<input type="radio" value="p" name="p" checked="checked" disabled="disabled"/> |
|---|
| 149 |
</td> |
|---|
| 150 |
<td> |
|---|
| 151 |
<input type="radio" value="-p" name="p" disabled="disabled"/> |
|---|
| 152 |
</td> |
|---|
| 153 |
</tr> |
|---|
| 154 |
<tr> |
|---|
| 155 |
<td class="level3"> |
|---|
| 156 |
<input type="checkbox" value="c" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.write.content" /> |
|---|
| 157 |
</td> |
|---|
| 158 |
<td> |
|---|
| 159 |
<input type="radio" value="c" name="c" checked="checked" disabled="disabled"/> |
|---|
| 160 |
</td> |
|---|
| 161 |
<td> |
|---|
| 162 |
<input type="radio" value="-c" name="c" disabled="disabled"/> |
|---|
| 163 |
</td> |
|---|
| 164 |
</tr> |
|---|
| 165 |
<tr> |
|---|
| 166 |
<td class="level3"> |
|---|
| 167 |
<input type="checkbox" value="b" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.create" /> |
|---|
| 168 |
</td> |
|---|
| 169 |
<td> |
|---|
| 170 |
<input type="radio" value="b" name="b" checked="checked" disabled="disabled"/> |
|---|
| 171 |
</td> |
|---|
| 172 |
<td> |
|---|
| 173 |
<input type="radio" value="-b" name="b" disabled="disabled"/> |
|---|
| 174 |
</td> |
|---|
| 175 |
</tr> |
|---|
| 176 |
<xsl:if test="$type = 'inbox' or $type = 'outbox'"> |
|---|
| 177 |
<tr> |
|---|
| 178 |
<td class="level4"> |
|---|
| 179 |
<input type="checkbox" value="S" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.schedule" /> |
|---|
| 180 |
</td> |
|---|
| 181 |
<td> |
|---|
| 182 |
<input type="radio" value="S" name="S" checked="checked" disabled="disabled"/> |
|---|
| 183 |
</td> |
|---|
| 184 |
<td> |
|---|
| 185 |
<input type="radio" value="-S" name="S" disabled="disabled"/> |
|---|
| 186 |
</td> |
|---|
| 187 |
</tr> |
|---|
| 188 |
<tr> |
|---|
| 189 |
<td class="level5"> |
|---|
| 190 |
<input type="checkbox" value="t" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.schedule.request" /> |
|---|
| 191 |
</td> |
|---|
| 192 |
<td> |
|---|
| 193 |
<input type="radio" value="t" name="t" checked="checked" disabled="disabled"/> |
|---|
| 194 |
</td> |
|---|
| 195 |
<td> |
|---|
| 196 |
<input type="radio" value="-t" name="t" disabled="disabled"/> |
|---|
| 197 |
</td> |
|---|
| 198 |
</tr> |
|---|
| 199 |
<tr> |
|---|
| 200 |
<td class="level5"> |
|---|
| 201 |
<input type="checkbox" value="y" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.schedule.reply" /> |
|---|
| 202 |
</td> |
|---|
| 203 |
<td> |
|---|
| 204 |
<input type="radio" value="y" name="y" checked="checked" disabled="disabled"/> |
|---|
| 205 |
</td> |
|---|
| 206 |
<td> |
|---|
| 207 |
<input type="radio" value="-y" name="y" disabled="disabled"/> |
|---|
| 208 |
</td> |
|---|
| 209 |
</tr> |
|---|
| 210 |
<tr> |
|---|
| 211 |
<td class="level5"> |
|---|
| 212 |
<input type="checkbox" value="s" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.schedule.freebusy" /> |
|---|
| 213 |
</td> |
|---|
| 214 |
<td> |
|---|
| 215 |
<input type="radio" value="s" name="s" checked="checked" disabled="disabled"/> |
|---|
| 216 |
</td> |
|---|
| 217 |
<td> |
|---|
| 218 |
<input type="radio" value="-s" name="s" disabled="disabled"/> |
|---|
| 219 |
</td> |
|---|
| 220 |
</tr> |
|---|
| 221 |
</xsl:if> |
|---|
| 222 |
<tr> |
|---|
| 223 |
<td class="level3"> |
|---|
| 224 |
<input type="checkbox" value="u" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> <xsl:value-of select="$util.entityAccessForm.delete" /> |
|---|
| 225 |
</td> |
|---|
| 226 |
<td> |
|---|
| 227 |
<input type="radio" value="u" name="u" checked="checked" disabled="disabled"/> |
|---|
| 228 |
</td> |
|---|
| 229 |
<td> |
|---|
| 230 |
<input type="radio" value="-u" name="u" disabled="disabled"/> |
|---|
| 231 |
</td> |
|---|
| 232 |
</tr> |
|---|
| 233 |
<!--<tr> |
|---|
| 234 |
<td class="level1"> |
|---|
| 235 |
<input type="checkbox" value="N" name="howItem" onclick="setupAccessForm(this, this.form)"/> None |
|---|
| 236 |
</td> |
|---|
| 237 |
<td> |
|---|
| 238 |
</td> |
|---|
| 239 |
<td> |
|---|
| 240 |
</td> |
|---|
| 241 |
</tr>--> |
|---|
| 242 |
</table> |
|---|
| 243 |
<!-- Simple Access Rights: --> |
|---|
| 244 |
<!-- the "how" field is set by getting the selected basicHowItem --> |
|---|
| 245 |
<ul id="howList"> |
|---|
| 246 |
<xsl:if test="/bedework/appvar[key='accessRightsToggle']/value='advanced'"> |
|---|
| 247 |
<xsl:attribute name="class">invisible</xsl:attribute> |
|---|
| 248 |
</xsl:if> |
|---|
| 249 |
<li> |
|---|
| 250 |
<input type="radio" value="A" name="basicHowItem"/><xsl:value-of select="$util.entityAccessForm.all" /> |
|---|
| 251 |
</li> |
|---|
| 252 |
<li> |
|---|
| 253 |
<input type="radio" value="R" name="basicHowItem" checked="checked"/><xsl:value-of select="$util.entityAccessForm.read.only" /> |
|---|
| 254 |
</li> |
|---|
| 255 |
</ul> |
|---|
| 256 |
|
|---|
| 257 |
<!-- below is a simplified listing using radio buttons only; keep for |
|---|
| 258 |
those who would like something inbetween the advanced and simple |
|---|
| 259 |
interfaces --> |
|---|
| 260 |
<!-- |
|---|
| 261 |
<ul id="howList"> |
|---|
| 262 |
<li><input type="radio" value="A" name="how"/> <strong>All</strong> (read, write, delete)</li> |
|---|
| 263 |
<li class="padTop"> |
|---|
| 264 |
<input type="radio" value="R" name="how" checked="checked"/> <strong>Read</strong> (content, access, freebusy) |
|---|
| 265 |
</li> |
|---|
| 266 |
<li> |
|---|
| 267 |
<input type="radio" value="F" name="how"/> Read freebusy only |
|---|
| 268 |
</li> |
|---|
| 269 |
<li class="padTop"> |
|---|
| 270 |
<input type="radio" value="W" name="how"/> <strong>Write and delete</strong> (content, access, properties) |
|---|
| 271 |
</li> |
|---|
| 272 |
<li> |
|---|
| 273 |
<input type="radio" value="c" name="how"/> Write content only |
|---|
| 274 |
</li> |
|---|
| 275 |
<li> |
|---|
| 276 |
<input type="radio" value="u" name="how"/> Delete only |
|---|
| 277 |
</li> |
|---|
| 278 |
<li class="padTop"> |
|---|
| 279 |
<input type="radio" value="Rc" name="how"/> <strong>Read</strong> and <strong>Write content only</strong> |
|---|
| 280 |
</li> |
|---|
| 281 |
<li class="padTop"> |
|---|
| 282 |
<input type="radio" value="N" name="how"/> <strong>None</strong> |
|---|
| 283 |
</li> |
|---|
| 284 |
</ul> --> |
|---|
| 285 |
</td> |
|---|
| 286 |
</tr> |
|---|
| 287 |
</table> |
|---|
| 288 |
<xsl:choose> |
|---|
| 289 |
<xsl:when test="$method = '2'"> |
|---|
| 290 |
<input type="button" name="updateACLs" value="update access" onclick="bwAcl.update(this.form)"/> |
|---|
| 291 |
</xsl:when> |
|---|
| 292 |
<xsl:otherwise> |
|---|
| 293 |
<input type="submit" name="submit" value="Submit"/> |
|---|
| 294 |
</xsl:otherwise> |
|---|
| 295 |
</xsl:choose> |
|---|
| 296 |
</xsl:template> |
|---|
| 297 |
</xsl:stylesheet> |
|---|