Index: /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/pagedUserSchemas.dpml
===================================================================
--- /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/pagedUserSchemas.dpml	(revision 4577)
+++ /cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/pagedUserSchemas.dpml	(revision 4578)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<sequence debug="false">
+<sequence debug="true">
     <log>
         <level>INFO</level>
@@ -17,4 +17,7 @@
         <param>arg:userID</param>
     </log>
+    <request assignment="schemaAuthorizedRoles">
+        <identifier>active:org.isocat.schemacat.access.data.schemas.authorizedRoles</identifier>
+    </request>
     <if assignment="response">
         <cond>
@@ -36,19 +39,57 @@
                     </request>
                 </argument>
-                <argument name="authorizedRoles" method="identity">
-                    <request>
-                        <identifier>active:org.isocat.schemacat.access.data.schemas.authorizedRoles</identifier>
-                    </request>
-                </argument>
+                <argument name="authorizedRoles" method="identity">this:schemaAuthorizedRoles</argument>
                 <argument name="user" method="identity">scratch:user</argument>
             </request>
         </cond>
         <then>
-            <request>
-                <identifier>active:org.isocat.schemacat.access.data.schemas.paged</identifier>
-                <argument name="userID">arg:userID</argument>
-                <argument name="startPage">arg:startPage</argument>
-                <argument name="pageSize">arg:pageSize</argument>
-            </request>
+            <if>
+                <!-- if user has schemas administration rights, source all the schemas -->
+                <cond>          
+                    <request>
+                        <identifier>active:sloot.xpath2</identifier>
+                        <argument name="operand">
+                            <request>
+                                <identifier>active:xslt2</identifier>
+                                <argument name="operand">scratch:user</argument>
+                                <argument name="operator">
+                                    <literal type="xml">
+                                        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sc="http://www.isocat.org/ns/schemacat" version="2.0">
+                                            <xsl:param name="authorizedRoles"/>
+                                            <xsl:param name="debug"/>
+                                            <xsl:template match="/">
+                                                <b><xsl:value-of select="string(/sc:user/sc:role = $authorizedRoles/roles/role)"/></b>
+                                            </xsl:template>
+                                        </xsl:stylesheet>
+                                    </literal>
+                                </argument>
+                                <argument name="authorizedRoles" method="identity">this:schemaAuthorizedRoles</argument>
+                                <argument name="debug">this:sloot-debug</argument>
+                            </request>
+                        </argument>
+                        <argument name="operator">
+                            <literal type="string">boolean(normalize-space(.)=('t','true'))</literal>
+                        </argument>
+                    </request>
+                </cond>
+                <then>
+                    <request>
+                        <identifier>active:org.isocat.schemacat.access.data.schemas.paged</identifier>
+                        <argument name="userID">
+                            <literal type="string">*</literal>
+                        </argument>
+                        <argument name="startPage">arg:startPage</argument>
+                        <argument name="pageSize">arg:pageSize</argument>
+                    </request>
+                </then>
+                <else>
+                    <request>
+                        <identifier>active:org.isocat.schemacat.access.data.schemas.paged</identifier>
+                        <argument name="userID">arg:userID</argument>
+                        <argument name="startPage">arg:startPage</argument>
+                        <argument name="pageSize">arg:pageSize</argument>
+                    </request>
+                </else>
+            </if>
         </then>
         <else>
