Changeset 3502
- Timestamp:
- 09/03/13 08:41:21 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/isAuthorized.dpml
r3485 r3502 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <sequence debug="true"> 3 <sloot-debug> 4 <request> 5 <verb>SINK</verb> 6 <identifier>res:/debug/org.isocat.schemacat.interface.isAuthorized.authorizedIDs.xml</identifier> 7 <argument name="primary">arg:authorizedIDs</argument> 8 </request> 9 <request> 10 <verb>SINK</verb> 11 <identifier>res:/debug/org.isocat.schemacat.interface.isAuthorized.authorizedRoles.xml</identifier> 12 <argument name="primary">arg:authorizedRoles</argument> 13 </request> 14 </sloot-debug> 3 15 <!-- TODO: check if enclosing request to sloot.xpath can be removed --> 4 16 <request assignment="response"> … … 12 24 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sc="http://www.isocat.org/ns/schemacat" version="2.0"> 13 25 <xsl:param name="authorizedIDs"/> 26 <xsl:param name="authorizedRoles"/> 14 27 <xsl:param name="debug"/> 15 28 <xsl:template match="/"> 16 <b><xsl:value-of select="string(/sc:user/sc:role = 'admin' or /sc:user/@xml:id = $authorizedIDs/id)"/></b>29 <b><xsl:value-of select="string(/sc:user/sc:role = $authorizedRoles/roles/role or /sc:user/@xml:id = $authorizedIDs/ids/id)"/></b> 17 30 </xsl:template> 18 31 </xsl:stylesheet> … … 20 33 </argument> 21 34 <argument name="authorizedIDs">arg:authorizedIDs</argument> 35 <argument name="authorizedRoles">arg:authorizedRoles</argument> 22 36 <argument name="debug">this:sloot-debug</argument> 23 37 </request> … … 31 45 <level>INFO</level> 32 46 <message> 33 <literal type="string">[interface.REST] User id [%1] authorized to access resource from id [%2]: [%3]</literal>47 <literal type="string">[interface.REST] [%1] authorized to access resource.
Authorized IDs:
[
%2]
Authorized roles:
[
%3]
=> [%4]</literal> 34 48 </message> 35 49 <param> … … 44 58 </param> 45 59 <param>arg:authorizedIDs</param> 60 <param> 61 <!-- pass the response trough sloot.xpath2 so the actual 62 user document is logged instead of the value of its pointer!--> 63 <request> 64 <identifier>active:sloot.xpath2</identifier> 65 <argument name="operand">arg:authorizedRoles</argument> 66 <argument name="operator"> 67 <literal type="xml"> 68 <dummy>.</dummy> 69 </literal> 70 </argument> 71 </request> 72 </param> 46 73 <param>this:response</param> 47 74 </log>
Note: See TracChangeset
for help on using the changeset viewer.