!Workflow Name: amset17getpermissions

!Constituent Services: AuthenticationService, AccessControlService, InitGetPermissionsWS, DateTimeWS

!Technical Notes

Platform: GlassFishESB V2.1, NetBeans IDE 6.5.1 (including BPEL Designer, implementing WS-BPEL 2.0)\\
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.0-b15\\
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb).
\\

Alfresco Labs 3.1 Final running on remote server, 64-bit Java 1.6.0_13, Tomcat 6 on Red Hat Enterprise Linux 5.


!Workflow Description

This workflow returns the permissions that __can __ be set on one or more given nodes. The nodes can be identified directly from given node references or indirectly as the resultset of a given Lucene or XPath search term. 

From the responses below, which refer to a folder and file used in these tests, it can be seen that the out-the-box permissions that are available are {{Editor}}, {{Consumer}}, {{Collaborator}}, {{Coordinator}}, {{Contributor}}.  These permissions are discussed in the Roles&Permission tab of [The Alfresco Repository Structure (JSR170)]
\\

!Input/Output

The snippets below show the SOAP requests and responses for a 1-node and 2-node request.

__Code snippet 17.1. AccessControlService.getParameters() SOAP request, 1 node reference.__


%%prettify 
{{{
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
        <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsu:Created>2009-08-30T18:48:48.98+00:00</wsu:Created>
                <wsu:Expires>2009-08-30T18:52:48.00+00:00</wsu:Expires>
            </wsu:Timestamp>
            <UsernameToken>
                <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_37de0a68c72d6d2be2e273e0023efc699c245602</Password>
                <Username>admin</Username>
            </UsernameToken>
        </Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <getPermissions
            xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0" xmlns:msgns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <ns0:predicate
                xmlns:acc="http://xml.netbeans.org/schema/accesscontrol"
                xmlns:init="http://j2ee.netbeans.org/wsdl/amset17getpermissions/InitGetPermissionsWS"
                xmlns:msgns="http://j2ee.netbeans.org/wsdl/amset17getpermissions/InitGetPermissionsWS"
                xmlns:ns="http://www.alfresco.org/ws/model/content/1.0" xmlns:ns0="http://www.alfresco.org/ws/service/accesscontrol/1.0">
                <ns:nodes>
                    <ns:store>
                        <ns:scheme>workspace</ns:scheme>
                        <ns:address>SpacesStore</ns:address>
                    </ns:store>
                    <ns:uuid>d8016a51-7df8-4fdb-aee7-64977dbfc6a3</ns:uuid>
                    <ns:path/>
                </ns:nodes>
                <ns:store>
                    <ns:scheme/>
                    <ns:address/>
                </ns:store>
                <ns:query>
                    <ns:language/>
                    <ns:statement/>
                </ns:query>
            </ns0:predicate>
        </getPermissions>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

}}}
/%

__Code snippet 17.2. AccessControlService.getParameters() SOAP response, 1 node reference.__


%%prettify 
{{{
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <getPermissionsResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <result>
                <reference>
                    <ns1:store xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
                        <ns1:scheme>workspace</ns1:scheme>
                        <ns1:address>SpacesStore</ns1:address>
                    </ns1:store>
                    <ns2:uuid xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0">d8016a51-7df8-4fdb-aee7-64977dbfc6a3</ns2:uuid>
                    <ns3:path xmlns:ns3="http://www.alfresco.org/ws/model/content/1.0">/app:company_home/cm:Waffle_x0020_Bus_x0020_Workflows/cm:What_x0020_is_x0020_the_x0020_Protein_x0020_Folding_x0020_Problem/cm:contains</ns3:path>
                </reference>
                <permissions>Editor</permissions>
                <permissions>Consumer</permissions>
                <permissions>Collaborator</permissions>
                <permissions>Coordinator</permissions>
                <permissions>Contributor</permissions>
            </result>
        </getPermissionsResponse>
    </soapenv:Body>
</soapenv:Envelope>

}}}
/%

__Code snippet 17.3. AccessControlService.getParameters() SOAP request, 2 node references.__


%%prettify 
{{{
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
        <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsu:Created>2009-08-30T18:49:28.17+00:00</wsu:Created>
                <wsu:Expires>2009-08-30T18:53:28.00+00:00</wsu:Expires>
            </wsu:Timestamp>
            <UsernameToken>
                <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_39aeaebab5f6728641bde64018829cf19c34ac08</Password>
                <Username>admin</Username>
            </UsernameToken>
        </Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <getPermissions
            xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0" xmlns:msgns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <ns0:predicate
                xmlns:acc="http://xml.netbeans.org/schema/accesscontrol"
                xmlns:init="http://j2ee.netbeans.org/wsdl/amset17getpermissions/InitGetPermissionsWS"
                xmlns:msgns="http://j2ee.netbeans.org/wsdl/amset17getpermissions/InitGetPermissionsWS"
                xmlns:ns="http://www.alfresco.org/ws/model/content/1.0" xmlns:ns0="http://www.alfresco.org/ws/service/accesscontrol/1.0">
                <ns:nodes>
                    <ns:store>
                        <ns:scheme>workspace</ns:scheme>
                        <ns:address>SpacesStore</ns:address>
                    </ns:store>
                    <ns:uuid>d8016a51-7df8-4fdb-aee7-64977dbfc6a3</ns:uuid>
                    <ns:path/>
                </ns:nodes>
                <ns:nodes>
                    <ns:store>
                        <ns:scheme>workspace</ns:scheme>
                        <ns:address>SpacesStore</ns:address>
                    </ns:store>
                    <ns:uuid>471d4bc3-5285-4f9e-9bab-f923943a76e0</ns:uuid>
                    <ns:path/>
                </ns:nodes>
                <ns:store>
                    <ns:scheme/>
                    <ns:address/>
                </ns:store>
                <ns:query>
                    <ns:language/>
                    <ns:statement/>
                </ns:query>
            </ns0:predicate>
        </getPermissions>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
}}}
/%

__Code snippet 17.4. AccessControlService.getParameters() SOAP response, 2 node references.__


%%prettify 
{{{
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <getPermissionsResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <result>
                <reference>
                    <ns1:store xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
                        <ns1:scheme>workspace</ns1:scheme>
                        <ns1:address>SpacesStore</ns1:address>
                    </ns1:store>
                    <ns2:uuid xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0">d8016a51-7df8-4fdb-aee7-64977dbfc6a3</ns2:uuid>
                    <ns3:path xmlns:ns3="http://www.alfresco.org/ws/model/content/1.0">/app:company_home/cm:Waffle_x0020_Bus_x0020_Workflows/cm:What_x0020_is_x0020_the_x0020_Protein_x0020_Folding_x0020_Problem/cm:contains</ns3:path>
                </reference>
                <permissions>Editor</permissions>
                <permissions>Consumer</permissions>
                <permissions>Collaborator</permissions>
                <permissions>Coordinator</permissions>
                <permissions>Contributor</permissions>
            </result>
            <result>
                <reference>
                    <ns4:store xmlns:ns4="http://www.alfresco.org/ws/model/content/1.0">
                        <ns4:scheme>workspace</ns4:scheme>
                        <ns4:address>SpacesStore</ns4:address>
                    </ns4:store>
                    <ns5:uuid xmlns:ns5="http://www.alfresco.org/ws/model/content/1.0">471d4bc3-5285-4f9e-9bab-f923943a76e0</ns5:uuid>
                    <ns6:path xmlns:ns6="http://www.alfresco.org/ws/model/content/1.0">/app:company_home/cm:Waffle_x0020_Bus_x0020_Workflows/cm:What_x0020_is_x0020_the_x0020_Protein_x0020_Folding_x0020_Problem/cm:contains/cm:contains</ns6:path>
                </reference>
                <permissions>Editor</permissions>
                <permissions>Consumer</permissions>
                <permissions>Collaborator</permissions>
                <permissions>Coordinator</permissions>
                <permissions>Contributor</permissions>
            </result>
        </getPermissionsResponse>
    </soapenv:Body>
</soapenv:Envelope>
}}}
/%