-
Notifications
You must be signed in to change notification settings - Fork 30
Lesson: Reading Hydra rightsMetadata XML
flyingzumwalt edited this page Apr 11, 2013
·
4 revisions
This Tutorial is known to work with hydra-head version 6.0.0..
Please update this wiki to reflect any other versions that have been tested.
Given a book whose permissions look like this:
puts book.permissions
{:type=>"group", :access=>"discover", :name=>"group2"}
{:type=>"group", :access=>"read", :name=>"group3"}
{:type=>"group", :access=>"read", :name=>"group9"}
{:type=>"group", :access=>"read", :name=>"group8"}
{:type=>"user", :access=>"read", :name=>"user3"}
{:type=>"user", :access=>"edit", :name=>"bob1"}
{:type=>"user", :access=>"edit", :name=>"sally2"}
The permissions will be written into the rightsMetadata datstream like so
puts book.rightsMetadata.to_xml
<rightsMetadata xmlns="http://hydra-collab.stanford.edu/schemas/rightsMetadata/v1" version="0.1">
<copyright>
<human type="title"/>
<human type="description"/>
<machine type="uri"/>
</copyright>
<access type="discover">
<human/>
<machine>
<group>group2</group>
</machine>
</access>
<access type="read">
<human/>
<machine>
<group>group3</group>
<group>group9</group>
<group>group8</group>
<person>user3</person>
</machine>
</access>
<access type="edit">
<human/>
<machine>
<person>bob1</person>
<person>sally2</person>
</machine>
</access>
<embargo>
<human/>
<machine/>
</embargo>
</rightsMetadata>
If we remove the nodes that aren't relevant to this lesson, the XML looks like this:
<rightsMetadata xmlns="http://hydra-collab.stanford.edu/schemas/rightsMetadata/v1" version="0.1">
<access type="discover">
<machine>
<group>group2</group>
</machine>
</access>
<access type="read">
<machine>
<group>group3</group>
<group>group9</group>
<group>group8</group>
<person>user3</person>
</machine>
</access>
<access type="edit">
<machine>
<person>bob1</person>
<person>sally2</person>
</machine>
</access>
</rightsMetadata>
Go on to ]] or return to the [[Access Controls with Hydra tutorial.