Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Div
stylefont-weight:bold;font-size:1.2em;
Authorization Service Home
Div
stylefont-weight:bold;font-size:1.2em;
Authorization Service RESTful APIs - Release v0.7 Alpha

REST-based API for Permission

The Authorization Service offers a REST-based Application Programming Interface (API) to CRUD (create, read, update, and delete) operations on individual permission instances, and on the associated permission and account instances. These follow the Common model for CollectionSpace REST services.

Note that the authorization service does not support extensible schema. That means, the request or response contains the payload only from a single schema, the Content-type header of application/xml is used.

...

Create and Update should use the following schema.

Code Block

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:permission xmlns:ns2="http://collectionspace.org/services/authorization">
    <resourceName>accounts</resourceName>
    <action>
        <name>CREATE</name>
    </action>
    <action>
        <name>READ</name>
    </action>
    <action>
        <name>UPDATE</name>
    </action>
    <action>
        <name>DELETE</name>
    </action>
    <action>
        <name>SEARCH</name>
    </action>
    <effect>PERMIT</effect>
</ns2:permission>

Read will return the above, plus additional fields (csid) for access:

Code Block

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:permission xmlns:ns2="http://collectionspace.org/services/authorization" csid="1e1cf935-6d43-4117-bd34-9f39bd4a00f6">
    <resourceName>accounts</resourceName>
    <action Hjid="1">
        <name>CREATE</name>
    </action>
    <action Hjid="2">
        <name>READ</name>
    </action>
    <action Hjid="3">
        <name>UPDATE</name>
    </action>
    <action Hjid="4">
        <name>DELETE</name>
    </action>
    <action Hjid="5">
        <name>SEARCH</name>
    </action>
    <effect>PERMIT</effect>
    <createdAt>2010-04-12T15:08:48.000</createdAt>
</ns2:permission>

...

List (and variants) will return the following schema. Note the standard pagination support.

Code Block

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:permissions_list xmlns:ns2="http://collectionspace.org/services/authorization">
<permission csid="1e1cf935-6d43-4117-bd34-9f39bd4a00f6">
    <resourceName>accounts</resourceName>
    <action Hjid="1">
        <name>CREATE</name></action>
    <action Hjid="2">
        <name>READ</name>
    </action>
    <action Hjid="3">
        <name>UPDATE</name>
    </action>
    <action Hjid="4">
        <name>DELETE</name>
    </action>
    <action Hjid="5">
        <name>SEARCH</name>
    </action>
    <effect>PERMIT</effect>
    <createdAt>2010-04-12T15:08:48.000</createdAt>
</permission>
<permission csid="9eb2a143-6613-4c68-87e3-6d9725871fff">
    <resourceName>collectionobjects</resourceName>
    <action Hjid="6">
        <name>CREATE</name>
    </action>
    <action Hjid="7">
        <name>READ</name>
    </action>
    <action Hjid="8">
        <name>UPDATE</name>
    </action>
    <action Hjid="9">
        <name>DELETE</name>
    </action>
    <action Hjid="10">
        <name>SEARCH</name>
    </action>
    <effect>PERMIT</effect>
    <createdAt>2010-04-12T15:08:58.000</createdAt>
</permission>

...