AdjustRightsCtrl

(let ((desired (map (lambda (n) (string->right (data n))) (form-field 'c (current-node)))) (to (make element gi: 'to (literal (oid->string (me 'get 'id))))) (from (make element gi: 'from (literal (oid->string (me 'get 'id)))))) (node-list (document-element (grove-root (current-node))) ; body unchanged (map (lambda (right) (make element gi: 'grant ns: 'mind to (right->node-list right))) desired) (map (lambda (right) (make element gi: 'revoke ns: 'mind from (right->node-list right))) (filter (lambda (c) (not (member c desired))) (me 'capabilities)))))

Source code:

<!--

  This control is used to change your own active rights.
  Basically the same thing happens as with grant/revoke,
  except that there's not second person, but instead the
  "potentialities" slot is changed.

-->
<dsssl:when xmlns:dsssl="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:mind="http://www.askemos.org/2000/CoreAPI" test="(equal? (data (form-field &quot;action&quot; (current-node))) &quot;adjust-capabilities&quot;) ">
 <mind:reply>
  <dsssl:copy-of select="#CONTENT">

(let ((desired (map (lambda (n) (string-&gt;right (data n)))
                    (form-field 'c (current-node))))
      (to (make element gi: 'to (literal (oid-&gt;string (me 'get 'id)))))
      (from (make element gi: 'from (literal (oid-&gt;string (me 'get 'id))))))
  (node-list
   (document-element (grove-root (current-node))) ; body unchanged
   (map
    (lambda (right)
     (make element gi: 'grant ns: 'mind to (right-&gt;node-list right)))
    desired)
   (map
     (lambda (right)
      (make element gi: 'revoke ns: 'mind from (right-&gt;node-list right)))
     (filter (lambda (c) (not (member c desired))) (me 'capabilities)))))

  </dsssl:copy-of>
 </mind:reply>
</dsssl:when>
<!--

 ;;; Local Variables: ***
 ;;; mode: dsssl ***
 ;;; End: ***

-->

Diese Seite findet man von: MetaCtrl, overview, .




Letzte Modifikation: Thu, 06 Feb 2003 14:37:08 +0100

Autor(en): jfw,

Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391 geliefert an public um Thu, 21 Aug 2008 23:47:52 +0200