Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/schemas.dpml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/schemas.dpml	(revision 3495)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/schemas.dpml	(revision 3495)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sequence debug="true">
+	<sloot-debug>
+		<log>
+			<level>INFO</level>
+			<message>
+				<literal type="string">[interface.REST] Requested list of schemas by id: %1</literal>
+			</message>
+			<param>
+				<request>
+					<identifier>active:sloot.xpath2</identifier>
+					<argument name="operand">scratch:user</argument>
+					<argument name="operator">
+						<literal type="string">string(/sc:user/@xml:id)</literal>
+					</argument>
+				</request>
+			</param>
+		</log>
+	</sloot-debug>
+	<if>
+		<cond>
+			<request>
+				<identifier>active:isAuthorized</identifier>
+				<argument name="authorizedIDs">
+					<literal type="xml">
+						<ids></ids>
+					</literal>
+				</argument>
+			</request>
+		</cond>
+		<then>
+			<request assignment="response">
+				<identifier>active:org.isocat.schemacat.access.data.schemas</identifier>
+				<argument name="userID">
+					<literal type="string"></literal>
+				</argument>
+			</request>
+		</then>
+		<else>
+			<request assignment="response">
+				<identifier>active:groovy</identifier>
+				<argument name="operator">
+					<!-- TODO: check if this is the proper way to generata a forbidden response -->
+					<literal type="string">
+						context.createResponseFrom("Forbidden!");
+						context.sink("httpResponse:/code", 403);
+					</literal>
+				</argument>
+			</request>
+		</else>
+	</if>
+	<sloot-debug>
+		<request>
+			<verb>SINK</verb>
+			<identifier>res:/debug/org.isocat.schemacat.interface.rest.user.schemas.response.xml</identifier>
+			<argument name="primary">this:response</argument>
+		</request>
+	</sloot-debug>
+</sequence>
Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/userSchemas.dpml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/userSchemas.dpml	(revision 3494)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/userSchemas.dpml	(revision 3495)
@@ -31,5 +31,5 @@
 		<then>
 			<request assignment="response">
-				<identifier>active:org.isocat.schemacat.access.data.user.schemas</identifier>
+				<identifier>active:org.isocat.schemacat.access.data.schemas</identifier>
 				<argument name="userID">arg:userID</argument>
 			</request>
Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/users.dpml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/users.dpml	(revision 3495)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/users.dpml	(revision 3495)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sequence debug="false">
+	<sloot-debug>
+		<log>
+			<level>INFO</level>
+			<message>
+				<literal type="string">[interface.REST] Requested users list by id: %1</literal>
+			</message>
+			<param>
+				<request>
+					<identifier>active:sloot.xpath2</identifier>
+					<argument name="operand">scratch:user</argument>
+					<argument name="operator">
+						<literal type="string">string(/sc:user/@xml:id)</literal>
+					</argument>
+				</request>
+			</param>
+		</log>
+	</sloot-debug>
+	<if>
+		<cond>
+			<request>
+				<identifier>active:isAuthorized</identifier>
+				<argument name="authorizedIDs">
+					<literal type="xml">
+						<ids></ids>
+					</literal>
+				</argument>
+			</request>
+		</cond>
+		<then>
+			<request assignment="response">
+				<identifier>active:org.isocat.schemacat.access.data.users</identifier>
+				<verb>SOURCE</verb>
+			</request>
+		</then>
+		<else>
+			<request assignment="response">
+				<identifier>active:groovy</identifier>
+				<argument name="operator">
+					<!-- TODO: check if this is the proper way to generata a forbidden response -->
+					<literal type="string">
+						context.createResponseFrom("Forbidden!");
+						context.sink("httpResponse:/code", 403);
+					</literal>
+				</argument>
+			</request>
+		</else>
+	</if>
+	<sloot-debug>
+		<request>
+			<verb>SINK</verb>
+			<identifier>res:/debug/org.isocat.schemacat.interface.rest.users.response.xml</identifier>
+			<argument name="primary">this:response</argument>
+		</request>
+	</sloot-debug>
+</sequence>
Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/module.xml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/module.xml	(revision 3494)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/module.xml	(revision 3495)
@@ -33,6 +33,4 @@
                   <mapper>
                      <config>
-                        <!-- TODO: all these .../rest/users/<user> endpoints should return some user info, the schemas would be returned from .../rest/users/<userID>/schemas -->
-                        <!-- TODO: where do we allow an optional trailing slash? .../rest/users(/)? but also .../rest/users/<user>(/)? ... look around a bit, what is common practice? -->
                         <endpoint>
                            <meta>
@@ -88,43 +86,36 @@
                            </request>
                         </endpoint>
-                        <!--  
-                         <endpoint>
-                           <!-/- the user isn't specified in the endpoint URL and it has a trailling slash /, use the requester ID from the scratch pad -/->
-                           <meta>
-                              <rest>
-                                 <method>GET</method>
-                                 <simple>users/</simple>
-                                 <compress/>
-                                 <Etag>MD5</Etag>
-                                 <preTarget>findUser</preTarget>
-                                 <produces>application/xml</produces>
-                              </rest>
-                           </meta>
-                           <grammar>
-                              <active>
-                                 <identifier>active:org.schemacat.user.xml</identifier>
-                                 <argument name="userID" min="1" max="1"/>
-                              </active>
-                           </grammar>
-                           <request>
-                              <identifier>active:sloot.dpml</identifier>
-                              <argument name="operator">res:/interface/userSchemas.dpml</argument>
-                              <argument name="userID">
+                        <endpoint>
+                           <meta>
+                              <rest>
+                                 <method>GET</method>
+                                 <simple>users{slash:(/|)}</simple>
+                                 <compress/>
+                                 <Etag>MD5</Etag>
+                                 <preTarget>findUser</preTarget>
+                                 <produces>application/json</produces>
+                              </rest>
+                           </meta>
+                           <grammar>
+                              <active>
+                                 <identifier>active:org.schemacat.users.json</identifier>
+                                 <argument name="slash"/>
+                              </active>
+                           </grammar>
+                           <request>
+                              <identifier>active:JSONFromXML</identifier>
+                              <argument name="operand">
                                  <request>
-                                    <identifier>active:sloot.xpath2</identifier>
-                                    <argument name="operand">scratch:user</argument>
-                                    <argument name="operator">
-                                       <literal type="string">string(/sc:user/@xml:id)</literal>
-                                    </argument>
+                                    <identifier>active:sloot.dpml</identifier>
+                                    <argument name="operator">res:/interface/users.dpml</argument>
                                  </request>
                               </argument>
                            </request>
                         </endpoint>
-                           <endpoint>
-                           <!-/- no trailling slash /, resource refers to all the users -/->
-                           <meta>
-                              <rest>
-                                 <method>GET</method>
-                                 <simple>users</simple>
+                        <endpoint>
+                           <meta>
+                              <rest>
+                                 <method>GET</method>
+                                 <simple>users{slash:(/|)}</simple>
                                  <compress/>
                                  <Etag>MD5</Etag>
@@ -135,5 +126,6 @@
                            <grammar>
                               <active>
-                                 <identifier>active:org.schemacat.user.xml</identifier>
+                                 <identifier>active:org.schemacat.users.xml</identifier>
+                                 <argument name="slash"/>
                               </active>
                            </grammar>
@@ -141,20 +133,11 @@
                               <identifier>active:sloot.dpml</identifier>
                               <argument name="operator">res:/interface/users.dpml</argument>
-                              <argument name="userID">
-                                 <request>
-                                    <identifier>active:sloot.xpath2</identifier>
-                                    <argument name="operand">scratch:user</argument>
-                                    <argument name="operator">
-                                       <literal type="string">string(/sc:user/@xml:id)</literal>
-                                    </argument>
-                                 </request>
-                              </argument>
-                           </request>
-                           </endpoint>-->
-                        <endpoint>
-                           <meta>
-                              <rest>
-                                 <method>GET</method>
-                                 <simple>users/{userID}/schemas</simple>
+                           </request>
+                        </endpoint>
+                        <endpoint>
+                           <meta>
+                              <rest>
+                                 <method>GET</method>
+                                 <simple>users/{userID}/schemas{slash:(/|)}</simple>
                                  <compress/>
                                  <Etag>MD5</Etag>
@@ -167,4 +150,5 @@
                                  <identifier>active:org.schemacat.user.schemas.json</identifier>
                                  <argument name="userID" min="1" max="1"/>
+                                 <argument name="slash"/>
                               </active>
                            </grammar>
@@ -184,5 +168,5 @@
                               <rest>
                                  <method>GET</method>
-                                 <simple>users/{userID}/schemas</simple>
+                                 <simple>users/{userID}/schemas{slash:(/|)}</simple>
                                  <compress/>
                                  <Etag>MD5</Etag>
@@ -195,4 +179,5 @@
                                  <identifier>active:org.schemacat.user.schemas.xml</identifier>
                                  <argument name="userID" min="1" max="1"/>
+                                 <argument name="slash"/>
                               </active>
                            </grammar>
@@ -201,4 +186,53 @@
                               <argument name="operator">res:/interface/userSchemas.dpml</argument>
                               <argument method="as-string" name="userID">arg:userID</argument>
+                           </request>
+                        </endpoint>
+                        <endpoint>
+                           <meta>
+                              <rest>
+                                 <method>GET</method>
+                                 <simple>schemas{slash:(/|)}</simple>
+                                 <compress/>
+                                 <Etag>MD5</Etag>
+                                 <preTarget>findUser</preTarget>
+                                 <produces>application/json</produces>
+                              </rest>
+                           </meta>
+                           <grammar>
+                              <active>
+                                 <identifier>active:org.schemacat.schemas.json</identifier>
+                                 <argument name="slash"/>
+                              </active>
+                           </grammar>
+                           <request>
+                              <identifier>active:JSONFromXML</identifier>
+                              <argument name="operand">
+                                 <request>
+                                    <identifier>active:sloot.dpml</identifier>
+                                    <argument name="operator">res:/interface/schemas.dpml</argument>
+                                 </request>
+                              </argument>
+                           </request>
+                        </endpoint>
+                        <endpoint>
+                           <meta>
+                              <rest>
+                                 <method>GET</method>
+                                 <simple>schemas{slash:(/|)}</simple>
+                                 <compress/>
+                                 <Etag>MD5</Etag>
+                                 <preTarget>findUser</preTarget>
+                                 <produces>application/xml</produces>
+                              </rest>
+                           </meta>
+                           <grammar>
+                              <active>
+                                 <identifier>active:org.schemacat.schemas.xml</identifier>
+                                 <argument name="slash"/>
+                              </active>
+                           </grammar>
+                           <request>
+                              <identifier>active:sloot.dpml</identifier>
+                              <argument name="operator">res:/interface/schemas.dpml</argument>
                            </request>
                         </endpoint>
