!Workflow Name: amset22getallauthorities

!Constituent Services: AuthenticationService, AccessControlService, InitGetAllAuthoritiesWS, 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

There are three {{AuthorityType}}s: {{USER}}, {{GROUP}} and {{ROLE}}.  An {{Authority}} is used to form an Authority Control Entry (ACE), which associates the {{Authority}} with {{Permission}}s on a {{node}} (resource).

\\

{{AccessControlService.getAllAuthorities()}} requires one of the three {{AuthorityType}}s as a {{filter}} and returns a list of the corresponding authorities.  Example outputs corresponding to the three cases are given below. (There were no roles in the system at at the time of the request.)

There is also a boolean {{rootOnly}} input element.  Refers to child authorities derived from root users, groups and roles?


!Input/Output

SOAP message that initiates workflow.  {{USER}} can be changed to {{GROUP}} or {{ROLE}}.

__Code snippet 22.1.  InitGetAllAuthoritiesWS SOAP request. 



%%prettify 
{{{
<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/amset22getallauthorities/InitGetAllAuthorities" xmlns:acc="http://xml.netbeans.org/schema/accesscontrol">
  <soapenv:Body>
    <init:InitGetAllAuthoritiesOperation>
      <alfrescoAdminUsername>admin</alfrescoAdminUsername>
      <alfrescoAdminPassword>adminPassword</alfrescoAdminPassword>
      <part1>
        <acc:getAllAuthorities>
          <acc:filter>
            <acc:authorityType>USER</acc:authorityType>
            <acc:rootOnly>false</acc:rootOnly>
          </acc:filter>
        </acc:getAllAuthorities>
      </part1>
    </init:InitGetAllAuthoritiesOperation>
  </soapenv:Body>
</soapenv:Envelope>
}}}
/%

__Code snippet 22.2.  AccessControlService.getAllAuthorities() SOAP request.__

%%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-09-01T08:00:15.90+00:00</wsu:Created>
                <wsu:Expires>2009-09-01T08:04:15.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_9dc0d25c3055458018e6bb773f6048cd5071a71a</Password>
                <Username>admin</Username>
            </UsernameToken>
        </Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <getAllAuthorities
            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/amset22getallauthorities/InitGetAllAuthorities"
            xmlns:msgns="http://j2ee.netbeans.org/wsdl/amset22getallauthorities/InitGetAllAuthorities" xmlns:ns0="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <acc:filter>
                <acc:authorityType>USER</acc:authorityType>
                <acc:rootOnly>false</acc:rootOnly>
            </acc:filter>
        </getAllAuthorities>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

}}}
/%

__Code snippet 22.3. AccessControlServic.getAllAuthorities(USER) SOAP response.__

%%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>
        <getAllAuthoritiesResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <results>InvisibleWoman</results>
            <results>flash</results>
            <results>user40</results>
            <results>user21</results>
            <results>user20</results>
            <results>mattereaterlad</results>
            <results>superman</results>
            <results>MrFantastic</results>
            <results>user41</results>
            <results>hawkman</results>
            <results>harrymcd</results>
            <results>magneto</results>
            <results>user31</results>
            <results>user30</results>
            <results>Thing2</results>
            <results>user11</results>
            <results>user10</results>
            <results>thor</results>
            <results>daredevil</results>
            <results>user100</results>
            <results>hawkman3</results>
            <results>user101</results>
            <results>user1</results>
            <results>user8</results>
            <results>user9</results>
        </getAllAuthoritiesResponse>
    </soapenv:Body>
</soapenv:Envelope>
}}}
/%

__Code snippet 22.4. AccessControlServic.getAllAuthorities(GROUP) SOAP response.__

%%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>
        <getAllAuthoritiesResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0">
            <results>GROUP_superheroes</results>
            <results>GROUP_heidbangers</results>
            <results>GROUP_ALFRESCO_ADMINISTRATORS</results>
            <results>GROUP_superheroes1</results>
            <results>GROUP_users</results>
            <results>GROUP_EMAIL_CONTRIBUTORS</results>
        </getAllAuthoritiesResponse>
    </soapenv:Body>
</soapenv:Envelope>
}}}
/%

__Code snippet 22.5. AccessControlServic.getAllAuthorities(ROLE) SOAP response.__

%%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>
        <getAllAuthoritiesResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0"/>
    </soapenv:Body>
</soapenv:Envelope>
}}}
/%