Workflow Name: amset18haspermissions#

Constituent Services: AuthenticationService, AccessControlService, InitHasPermissionsWS, 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 service takes a list of permissions and a set of nodes and returns the AccessStatus (acepted (sic) or declined) with respect to the authenticated user. For example, snippet 18.1 shows an enquiry about the Editor, Collaborator and Coordinator permissions on the node, workspace://SpacesStore/a390583c-1704-4fb5-955f-826d5a9f8563.

Input/Output#

Code snippet 18.1. InitHasPermissionsWS SOAP request.

<soapenv:Envelope xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:init="http://j2ee.netbeans.org/wsdl/amset18haspermissions/InitHasPermissionsWS" xmlns:acc="http://xml.netbeans.org/schema/accesscontrol" xmlns:ns="http://www.alfresco.org/ws/model/content/1.0">
  <soapenv:Body>
    <init:InitHasPermissionsWSOperation>
      <alfrescoAdminUsername>admin</alfrescoAdminUsername>
      <alfrescoAdminPassword>adminPassword</alfrescoAdminPassword>
      <part1>
        <acc:hasPermissions>
          <acc:predicate> 
            <ns:nodes>
              <ns:store>
                <ns:scheme>workspace</ns:scheme>
                <ns:address>SpacesStore</ns:address>
              </ns:store>
              <ns:uuid>a390583c-1704-4fb5-955f-826d5a9f8563</ns:uuid>
              <ns:path></ns:path>
            </ns:nodes>
            <ns:store> 
              <ns:scheme></ns:scheme>
              <ns:address></ns:address>
            </ns:store>
            <ns:query>
              <ns:language></ns:language>
              <ns:statement></ns:statement>
            </ns:query>
          </acc:predicate>
          <acc:permissions>Editor</acc:permissions>
          <acc:permissions>Collaborator</acc:permissions>
          <acc:permissions>Coordinator</acc:permissions>
        </acc:hasPermissions>
      </part1>
    </init:InitHasPermissionsWSOperation>
  </soapenv:Body>
</soapenv:Envelope>

Code snippet 18.2. AccessControlService.hasPermissions() SOAP request.

<?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-31T10:56:08.30+00:00</wsu:Created>
                <wsu:Expires>2009-08-31T11:00:08.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_b8d0453c7775a6cb116e10cd6223afe52077a85c</Password>
                <Username>admin</Username>
            </UsernameToken>
        </Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <hasPermissions
            xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0"
            xmlns:acc="http://xml.netbeans.org/schema/accesscontrol"
            xmlns:init="http://j2ee.netbeans.org/wsdl/amset18haspermissions/InitHasPermissionsWS"
            xmlns:msgns="http://j2ee.netbeans.org/wsdl/amset18haspermissions/InitHasPermissionsWS"
            xmlns:ns="http://www.alfresco.org/ws/model/content/1.0" xmlns:ns0="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <acc:predicate>
                <ns:nodes>
                    <ns:store>
                        <ns:scheme>workspace</ns:scheme>
                        <ns:address>SpacesStore</ns:address>
                    </ns:store>
                    <ns:uuid>a390583c-1704-4fb5-955f-826d5a9f8563</ns:uuid>
                    <ns:path/>
                </ns:nodes>
                <ns:store>
                    <ns:scheme/>
                    <ns:address/>
                </ns:store>
                <ns:query>
                    <ns:language/>
                    <ns:statement/>
                </ns:query>
            </acc:predicate>
            <acc:permissions>Editor</acc:permissions>
            <acc:permissions>Collaborator</acc:permissions>
            <acc:permissions>Coordinator</acc:permissions>
        </hasPermissions>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Code snippet 18.3. AccessControlService.hasPermissions() SOAP response.

<?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>
        <hasPermissionsResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <results>
                <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">a390583c-1704-4fb5-955f-826d5a9f8563</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</ns3:path>
                </reference>
                <permission>Editor</permission>
                <accessStatus>acepted</accessStatus>
            </results>
            <results>
                <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">a390583c-1704-4fb5-955f-826d5a9f8563</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</ns6:path>
                </reference>
                <permission>Collaborator</permission>
                <accessStatus>acepted</accessStatus>
            </results>
            <results>
                <reference>
                    <ns7:store xmlns:ns7="http://www.alfresco.org/ws/model/content/1.0">
                        <ns7:scheme>workspace</ns7:scheme>
                        <ns7:address>SpacesStore</ns7:address>
                    </ns7:store>
                    <ns8:uuid xmlns:ns8="http://www.alfresco.org/ws/model/content/1.0">a390583c-1704-4fb5-955f-826d5a9f8563</ns8:uuid>
                    <ns9:path xmlns:ns9="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</ns9:path>
                </reference>
                <permission>Coordinator</permission>
                <accessStatus>acepted</accessStatus>
            </results>
        </hasPermissionsResponse>
    </soapenv:Body>
</soapenv:Envelope>

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-) was last changed on 06-Sep-2009 13:47 by clayton