<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #358: Resources in REST API</title>
    <link>http://localhost/ticket/358</link>
    <description>&lt;p&gt;
(spun out of &lt;a class="closed ticket" href="http://localhost/ticket/336" title="defect: Resource Search API (closed: fixed)"&gt;ticket:336&lt;/a&gt;)
&lt;/p&gt;
&lt;p&gt;
Resource added to model API at:
&lt;/p&gt;
&lt;p&gt;
api/rest/resource
&lt;/p&gt;
&lt;h3 id="Examplemodelrequest"&gt;Example model request&lt;/h3&gt;
&lt;p&gt;
GET to: /api/2/rest/resource/a3dd8f64-9078-4f04-845c-e3f047125028
&lt;/p&gt;
&lt;p&gt;
returns:
&lt;/p&gt;
&lt;pre class="wiki"&gt; [{"id": "a3dd8f64-9078-4f04-845c-e3f047125028",
   "package_id": "b8a325c8-af2a-43f3-8245-9db7d73dfbfe",
   "URL": "http://scraperwiki.com/lincolnshire-councillors",
   "format": "CSV",
   "Description": "Scrape of www.lincs.gov/councillors.pdf by ScraperWiki.",
   "hash": "",
   "position": 2
 }]
&lt;/pre&gt;&lt;h2 id="Authorization"&gt;Authorization&lt;/h2&gt;
&lt;ol&gt;&lt;li&gt;Have it generic (ie. not per resource) and use an action/role on system
&lt;/li&gt;&lt;li&gt;Require all resources to attach to packages an inherit their permissions (i.e. read/write etc if and only read/write on associated packages)
&lt;/li&gt;&lt;li&gt;Introduce Resource in authorization system (requires migration)
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
Mixed model
&lt;/p&gt;
&lt;pre class="wiki"&gt;Create / Edit:
if resource associated to package:
    check_permissions(package, update)
else:
    check_system_permissions(c.user, model.Action.Resouce Create/Update, model.System)
&lt;/pre&gt;</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/358</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Tue, 27 Jul 2010 21:42:08 GMT</pubDate>
      <title>milestone deleted</title>
      <link>http://localhost/ticket/358#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                &lt;em&gt;v1.1&lt;/em&gt; deleted
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 06 Oct 2010 14:38:38 GMT</pubDate>
      <title>priority, type changed</title>
      <link>http://localhost/ticket/358#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;priority&lt;/strong&gt;
                changed from &lt;em&gt;critical&lt;/em&gt; to &lt;em&gt;major&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;type&lt;/strong&gt;
                changed from &lt;em&gt;enhancement&lt;/em&gt; to &lt;em&gt;defect&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>pudo</dc:creator>

      <pubDate>Mon, 03 Jan 2011 11:21:15 GMT</pubDate>
      <title>milestone set</title>
      <link>http://localhost/ticket/358#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                set to &lt;em&gt;iati-4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Mon, 18 Apr 2011 10:18:15 GMT</pubDate>
      <title>owner changed; repo, theme set</title>
      <link>http://localhost/ticket/358#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;dread&lt;/em&gt; to &lt;em&gt;rgrp&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;repo&lt;/strong&gt;
                set to &lt;em&gt;ckan&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;theme&lt;/strong&gt;
                set to &lt;em&gt;none&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>kindly</dc:creator>

      <pubDate>Mon, 18 Apr 2011 10:21:49 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/358#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:5</guid>
      <description>
        &lt;p&gt;
This ticket needs to have a more thorough spec which needs to include.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Examples of put/post requests to resources and if they are needed.
&lt;/li&gt;&lt;li&gt;Dealing with resources that do not have a related packages in terms of authorization. Do they have a new action? how granular is the authorization? per resource? system level? etc.
&lt;/li&gt;&lt;li&gt;The rules related to authorization for resources attached to packages. i.e you only get read permissions when the related package has read permissions? do they have their own rules?
&lt;/li&gt;&lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Mon, 18 Apr 2011 10:46:51 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/358#comment:6</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:6</guid>
      <description>
        &lt;p&gt;
This ticket was designed only for reading resources, following an ongoing requirement from the Scraperwiki collaboration. Assume PUT/POST is out of scope.
&lt;/p&gt;
&lt;p&gt;
I suggest dealing with resources that aren't attached to packages in an entirely new ticket or CEP, as the implications are wider than this aspect of the API.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 18 Apr 2011 11:15:16 GMT</pubDate>
      <title>type, description, milestone changed</title>
      <link>http://localhost/ticket/358#comment:7</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:7</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;type&lt;/strong&gt;
                changed from &lt;em&gt;defect&lt;/em&gt; to &lt;em&gt;enhancement&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/358?action=diff&amp;amp;version=7"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;iati-4&lt;/em&gt; to &lt;em&gt;ckan-v1.5&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>thejimmyg</dc:creator>

      <pubDate>Fri, 08 Jul 2011 12:39:42 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/358#comment:8</link>
      <guid isPermaLink="false">http://localhost/ticket/358#comment:8</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;duplicate&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Merging with &lt;a class="closed ticket" href="http://localhost/ticket/922" title="enhancement: Make Resources first class entity. (closed: duplicate)"&gt;#922&lt;/a&gt; go there for latest updates.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>