Changeset 2074

Show
Ignore:
Timestamp:
02/24/09 17:34:52
Author:
johnsa
Message:

user client: deprecate method 1 access control in favor of method 2 (javascript)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.css

    r2050 r2074  
    17681768#bedework #sharingBox { 
    17691769  margin: 0; 
    1770   border-top: 1px solid #333; 
    1771   padding: 1em 1em 2em 1em; 
     1770  padding: 1em 0 0 0; 
    17721771} 
    17731772#bedework #bwEventTab-Access #sharingBox { 
    1774   border-top: none; 
     1773  margin: 0; 
     1774  padding: 1em; 
    17751775} 
    17761776#bedework #sharingBox h3, 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r2061 r2074  
    387387      var startTzid = "<xsl:value-of select="/bedework/formElements/form/start/tzid"/>"; 
    388388      var endTzid = "<xsl:value-of select="/bedework/formElements/form/end/dateTime/tzid"/>"; 
     389      var resourcesRoot = "<xsl:value-of select="$resourcesRoot"/>"; 
    389390    </script> 
     391 
    390392    <!-- note: the non-breaking spaces in the script bodies below are to avoid 
    391393         losing the script closing tags (which avoids browser problems) --> 
     
    400402      <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkPrefs.js">&#160;</script> 
    401403    </xsl:if> 
    402     <xsl:if test="/bedework/page='modCalendar' or 
    403                   /bedework/page='eventAccess'"> 
     404    <xsl:if test="/bedework/page='modCalendar'"> 
    404405      <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkAccess.js">&#160;</script> 
     406      <!-- initialize calendar acls, if present --> 
     407      <xsl:if test="/bedework/currentCalendar/acl/ace"> 
     408        <script type="text/javascript"> 
     409          <xsl:apply-templates select="/bedework/currentCalendar/acl/ace" mode="initJS"/> 
     410        </script> 
     411      </xsl:if> 
    405412    </xsl:if> 
    406413    <xsl:if test="/bedework/page='attendees'"> 
     
    442449      <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkXProperties.js">&#160;</script> 
    443450      <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkAccess.js">&#160;</script> 
    444     </xsl:if> 
    445     <xsl:if test="/bedework/editableAccess/access/acl/ace"> 
    446       <script type="text/javascript"> 
    447         <xsl:apply-templates select="/bedework/editableAccess/access/acl/ace" mode="initJS"/> 
    448       </script> 
     451      <!-- initialize event acls, if present --> 
     452      <xsl:if test="/bedework/editableAccess/access/acl/ace"> 
     453        <script type="text/javascript"> 
     454          <xsl:apply-templates select="/bedework/editableAccess/access/acl/ace" mode="initJS"/> 
     455        </script> 
     456      </xsl:if> 
    449457    </xsl:if> 
    450458    <xsl:if test="/bedework/page='editEvent'"> 
     
    35153523                  <th>Access</th> 
    35163524                  <th>Inherited from</th> 
    3517                   <td></td
     3525                  <th></th
    35183526                </tr> 
    35193527              </thead> 
     
    48374845        </xsl:otherwise> 
    48384846      </xsl:choose> 
     4847 
     4848      <table border="0" id="submitTable"> 
     4849        <tr> 
     4850          <td> 
     4851            <xsl:choose> 
     4852              <xsl:when test="isSubscription='true'"> 
     4853                <input type="submit" name="updateCalendar" value="Update Subscription"/> 
     4854              </xsl:when> 
     4855              <xsl:when test="calType = '0'"> 
     4856                <input type="submit" name="updateCalendar" value="Update Folder"/> 
     4857              </xsl:when> 
     4858              <xsl:otherwise> 
     4859                <input type="submit" name="updateCalendar" value="Update Calendar"/> 
     4860              </xsl:otherwise> 
     4861            </xsl:choose> 
     4862            <input type="submit" name="cancelled" value="cancel"/> 
     4863          </td> 
     4864          <td align="right"> 
     4865            <xsl:choose> 
     4866              <xsl:when test="isSubscription='true'"> 
     4867                <input type="submit" name="delete" value="Delete Subscription"/> 
     4868              </xsl:when> 
     4869              <xsl:when test="calType = '0'"> 
     4870                <input type="submit" name="delete" value="Delete Folder"/> 
     4871              </xsl:when> 
     4872              <xsl:otherwise> 
     4873                <input type="submit" name="delete" value="Delete Calendar"/> 
     4874              </xsl:otherwise> 
     4875            </xsl:choose> 
     4876          </td> 
     4877        </tr> 
     4878      </table> 
     4879 
    48394880      <table class="common"> 
    48404881        <tr> 
     
    49174958      </table> 
    49184959 
     4960      <div id="sharingBox"> 
     4961        <xsl:choose> 
     4962          <xsl:when test="acl"> 
     4963            <xsl:apply-templates select="acl" mode="currentAccess"> 
     4964              <xsl:with-param name="action" select="$calendar-setAccess"/> 
     4965              <xsl:with-param name="calPathEncoded" select="$calPathEncoded"/> 
     4966              <xsl:with-param name="method">2</xsl:with-param> 
     4967            </xsl:apply-templates> 
     4968          </xsl:when> 
     4969          <xsl:otherwise> 
     4970            <h3>Current Access:</h3> 
     4971            <table class="common scheduling" id="bwCurrentAccess"> 
     4972              <thead> 
     4973                <tr> 
     4974                  <th>Entry</th> 
     4975                  <th>Access</th> 
     4976                  <th>Inherited from</th> 
     4977                  <th></th> 
     4978                </tr> 
     4979              </thead> 
     4980              <tbody> 
     4981                <tr id="bwEventNoAcl"> 
     4982                  <td colspan="4">no access defined</td> 
     4983                </tr> 
     4984              </tbody> 
     4985            </table> 
     4986          </xsl:otherwise> 
     4987        </xsl:choose> 
     4988        <xsl:call-template name="entityAccessForm"> 
     4989          <xsl:with-param name="method">2</xsl:with-param> 
     4990        </xsl:call-template> 
     4991      </div> 
     4992 
     4993      <div class="note"> 
     4994        <p><strong>Note:</strong> If you grant write access to another user, and you wish 
     4995          to see events added by that user in your calendar, <strong>you must explicitly 
     4996          grant yourself access to the same calendar.</strong>  Enter your RCS UserID as 
     4997          a user in the "Who" box with "All" set in the "Rights" box. 
     4998        </p> 
     4999        <p> 
     5000          This is standard access control; the reason you will not see the other 
     5001          user's events without doing this is that the default access is grant:all to 
     5002          "owner" - and you don't own the other user's events. 
     5003        </p> 
     5004      </div> 
     5005 
    49195006      <table border="0" id="submitTable"> 
    49205007        <tr> 
     
    49495036      </table> 
    49505037    </form> 
    4951     <div id="sharingBox"> 
     5038    <!-- Method 1 access setting is now deprecated. 
     5039         see the "entityAccessForm" template for more information --> 
     5040    <!--  div id="sharingBox"> 
    49525041      <xsl:apply-templates select="acl" mode="currentAccess"> 
    49535042        <xsl:with-param name="action" select="$calendar-setAccess"/> 
     
    49665055        </xsl:call-template> 
    49675056      </form> 
    4968     </div> 
    4969     <div class="note"> 
    4970       <p><strong>Note:</strong> If you grant write access to another user, and you wish 
    4971         to see events added by that user in your calendar, <strong>you must explicitly 
    4972         grant yourself access to the same calendar.</strong>  Enter your RCS UserID as 
    4973         a user in the "Who" box with "All" set in the "Rights" box. 
    4974       </p> 
    4975       <p> 
    4976         This is standard access control; the reason you will not see the other 
    4977         user's events without doing this is that the default access is grant:all to 
    4978         "owner" - and you don't own the other user's events. 
    4979       </p> 
    4980     </div> 
     5057    </div --> 
    49815058  </xsl:template> 
    49825059 
     
    77117788  <xsl:template name="entityAccessForm"> 
    77127789    <xsl:param name="type"/><!-- optional: currently used for inbox and outbox to conditionally display scheduling access --> 
    7713     <xsl:param name="method">1</xsl:param><!-- optional: 
     7790    <xsl:param name="method">2</xsl:param><!-- optional: 
    77147791      there are two methods of setting access 
    77157792      - method 1, the older method, uses a single request/response per principal 
    77167793      - method 2 constructs a javascript object that commits the entire ACL 
    77177794        structure in a single request 
    7718       Both methods are currently supported.  Method one is used for calendars, 
    7719       method two for setting event access.  At some point we may move all access 
    7720       control setting to method two. --> 
     7795      Both methods are currently supported.  Method two is now the default. --> 
    77217796    <xsl:param name="acl"/><!-- nodeset of entity acls used to initialize 
    77227797      javascript object. Required for method two. --> 
     
    77407815              <input type="radio" value="all" name="whoType"/> all users 
    77417816            </p> 
     7817            <xsl:choose> 
     7818              <xsl:when test="$method = '2'"> 
     7819                <input type="button" name="updateACLs" value="add entry" onclick="bwAcl.update(this.form)"/> 
     7820              </xsl:when> 
     7821              <xsl:otherwise> 
     7822                <input type="submit" name="submit" value="update access"/> 
     7823              </xsl:otherwise> 
     7824            </xsl:choose> 
    77427825          </div> 
    77437826        </td> 
     
    79628045            </li> 
    79638046          </ul> 
    7964  
    7965           <!-- below is a simplified listing using radio buttons only; keep for 
    7966                those who would like something inbetween the advanced and simple 
    7967                interfaces --> 
    7968           <!-- 
    7969           <ul id="howList"> 
    7970             <li><input type="radio" value="A" name="how"/> <strong>All</strong> (read, write, delete)</li> 
    7971             <li class="padTop"> 
    7972               <input type="radio" value="R" name="how" checked="checked"/> <strong>Read</strong> (content, access, freebusy) 
    7973             </li> 
    7974             <li> 
    7975               <input type="radio" value="F" name="how"/> Read freebusy only 
    7976             </li> 
    7977             <li class="padTop"> 
    7978               <input type="radio" value="W" name="how"/> <strong>Write and delete</strong> (content, access, properties) 
    7979             </li> 
    7980             <li> 
    7981               <input type="radio" value="c" name="how"/> Write content only 
    7982             </li> 
    7983             <li> 
    7984              <input type="radio" value="u" name="how"/> Delete only 
    7985             </li> 
    7986             <li class="padTop"> 
    7987               <input type="radio" value="Rc" name="how"/> <strong>Read</strong> and <strong>Write content only</strong> 
    7988             </li> 
    7989             <li class="padTop"> 
    7990               <input type="radio" value="N" name="how"/> <strong>None</strong> 
    7991             </li> 
    7992           </ul> --> 
    79938047        </td> 
    79948048      </tr> 
    79958049    </table> 
    7996     <xsl:choose> 
    7997       <xsl:when test="$method = '2'"> 
    7998         <input type="button" name="updateACLs" value="update access" onclick="bwAcl.update(this.form)"/> 
    7999       </xsl:when> 
    8000       <xsl:otherwise> 
    8001         <input type="submit" name="submit" value="Submit"/> 
    8002       </xsl:otherwise> 
    8003     </xsl:choose> 
    80048050  </xsl:template> 
    80058051 
     
    80108056    <xsl:param name="recurrenceId"/> <!-- optional (for entities) --> 
    80118057    <xsl:param name="what"/> <!-- optional (for scheduling only) --> 
    8012     <xsl:param name="method">1</xsl:param> <!-- which method of access control 
     8058    <xsl:param name="method">2</xsl:param> <!-- which method of access control 
    80138059      are we using: 1 (one request per pricipal) or 2 (set all with 
    80148060      javascript and send entire ACL to server) --> 
     
    80208066          <th>Access</th> 
    80218067          <th>Inherited from</th> 
    8022           <td></td
     8068          <th></th
    80238069        </tr> 
    80248070      </thead> 
     
    81238169                    <xsl:variable name="rowPos" select="position()-1"/> 
    81248170                    <a href="javascript:bwAcl.deleteAce({$rowPos})" title="reset to default"> 
    8125                       remove 
     8171                      <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="reset to default"/> 
    81268172                    </a> 
    81278173                  </xsl:when> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkAccess.js

    r1607 r2074  
    5252var otherStr = "other"; 
    5353var grantStr = "grant"; 
     54var denyStr = "deny" 
    5455var allStr = "all"; 
    5556 
    5657var deleteStr = "remove"; 
     58 
     59// note that resourcesRoot is passed in from the html head section defined in the xslt 
     60var trashIcon = '<img src="' + resourcesRoot  + '/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>'; 
     61var userIcon = '<img src="' + resourcesRoot  + '/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>'; 
     62var groupIcon = '<img src="' + resourcesRoot  + '/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>'; 
    5763 
    5864// How granted accesses appear 
     
    106112/* We shouldn't use the word local - it probably doesn't mean too much and it might actually be 
    107113   inherited from something called /local for example */ 
    108 var inheritedStr = "Not inherited"; 
     114var inheritedStr = "not inherited"; 
    109115 
    110116// ************************** 
     
    325331  this.format = function() { 
    326332    if (whoType == "user") { 
    327       return who; 
     333      return userIcon + " " + who; 
    328334    } 
    329335 
    330336    if (whoType == "group") { 
    331       return who; 
     337      return groupIcon + " " + who; 
    332338    } 
    333339 
     
    337343 
    338344    if (whoType == "auth") { 
    339       return authenticatedStr; 
     345      return groupIcon + " " + authenticatedStr; 
    340346    } 
    341347 
    342348    if (whoType == "unauth") { 
    343       return unauthenticatedStr; 
     349      return groupIcon + " " + unauthenticatedStr; 
    344350    } 
    345351 
    346352    if (whoType == "owner") { 
    347       return ownerStr; 
     353      return userIcon + " " + ownerStr; 
    348354    } 
    349355 
    350356    if (whoType == "other") { 
    351       return otherStr; 
     357      return groupIcon + " " + otherStr; 
    352358    } 
    353359 
    354360    if (whoType == "all") { 
    355       return allStr; 
     361      return groupIcon + " " + allStr; 
    356362    } 
    357363 
     
    506512  // aceI: index of the ace 
    507513  this.toFormRow = function(row, aceI) { 
    508     row.insertCell(0).appendChild(document.createTextNode(this.principal.format())); 
     514    var td_0 = row.insertCell(0); 
     515    td_0.innerHTML = this.principal.format(); 
    509516    row.insertCell(1).appendChild(document.createTextNode(this.formatHow())); 
    510517    row.insertCell(2).appendChild(document.createTextNode(this.formatInherited())); 
    511518    var td_3 = row.insertCell(3); 
    512519    if (this.inherited == "") { 
    513       td_3.innerHTML = "<a href=\"javascript:bwAcl.deleteAce('" + aceI + "')\">" + deleteStr + "</a>"; 
     520      td_3.innerHTML = "<a href=\"javascript:bwAcl.deleteAce('" + aceI + "')\">" + trashIcon + " " + deleteStr + "</a>"; 
    514521    } 
    515522  }