<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1094: [super] Refactor the Auth System</title>
    <link>http://localhost/ticket/1094</link>
    <description>&lt;p&gt;
Here are some proposed changes related to CKAN's authorization system - they aren't very big, but should provide for some forthcoming use cases including &lt;a class="closed ticket" href="http://localhost/ticket/787" title="task: Auth API (closed: fixed)"&gt;#787&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Two man reasons for the changes are:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;We have a completely refactored architecture now which introduces a logic layer. These Auth changes are designed to better support the way we work with that layer.
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Different CKAN extension apps may need radically different authentication/authorisation so we need to allow whatever we have to be override-able.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
The first two changes revolve around the is_authorized method, which
is called by the logic layer to ask whether a particular user (e.g.
Bob) is allowed to do a certain action (e.g. edit) on a certain object (e.g. Package).
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;The first thing the is_authorized method is a hook to a plugin
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
which *overrides* the current call with its own implementation (note: in previous discussions we have considered allowing a chain of plugins, no longer!)
&lt;/p&gt;
&lt;p&gt;
Reason: authorization can be completely delegated to another system
(or partially)
&lt;/p&gt;
&lt;ol start="2"&gt;&lt;li&gt;is_authorized method currently takes (username, action, object)
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
but for action=create_package, the object supplied is System, and for action=edit the object supplied is the package. Instead action should always be the string name of a function in the logic layer and object should always be the object passed to that function. This means our auth system is based around the actual actions we are performing (rather than a model them) and with the actual data that forms the action (rather than a related object). You never need a System object in this model.
&lt;/p&gt;
&lt;ol start="3"&gt;&lt;li&gt;Rename these two classes to better reflect what they are
&lt;ul&gt;&lt;li&gt;&lt;a class="missing wiki"&gt;AuthorizationGroup?&lt;/a&gt; -&amp;gt; &lt;a class="missing wiki"&gt;UserGroup?&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;Group -&amp;gt; &lt;a class="missing wiki"&gt;PackageGroup?&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start="4"&gt;&lt;li&gt;Rename the Editor role to &lt;a class="missing wiki"&gt;PriveledgeUser?&lt;/a&gt; since Editors sometimes can't edit.
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
Although this sounds a bit radical we already have auth extensions.
&lt;/p&gt;
&lt;h2 id="Read-onlyCKANWebUI"&gt;Read-only CKAN Web UI&lt;/h2&gt;
&lt;p&gt;
(Additional requirement from &lt;a class="closed ticket" href="http://localhost/ticket/764" title="enhancement: Read-only CKAN Web UI (closed: duplicate)"&gt;#764&lt;/a&gt;)
&lt;/p&gt;
&lt;p&gt;
Whilse using CKAN web interface, you are not tempted to edit stuff:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;You know at all times this CKAN is read-only
&lt;/li&gt;&lt;li&gt;All editing facilities are still seen but greyed-out with an indication why it is.
&lt;/li&gt;&lt;/ul&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/1094</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 18 Apr 2011 12:27:50 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1094#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1094#comment:1</guid>
      <description>
        &lt;p&gt;
See also comments on the mailing list.
&lt;/p&gt;
&lt;p&gt;
Item 1 seems fine (what is difference from current extension mechanism?)
&lt;/p&gt;
&lt;p&gt;
Item 2: concerns here. What about list views? What about editing 'permissions'? I also think getting rid of System object isn't really a benefit (if anything may be a cost).
&lt;/p&gt;
&lt;p&gt;
Item 3: feel this may be better as part of big domain model change (also gives us time to really dig into this -- this is an important requirement/conceptual issue).
&lt;/p&gt;
&lt;p&gt;
Item 4: No objections but seems very minor gain for fairly significant migration work.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnlawrenceaspden</dc:creator>

      <pubDate>Mon, 02 May 2011 16:33:56 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1094#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1094#comment:2</guid>
      <description>
        &lt;p&gt;
&lt;a class="missing wiki"&gt;UserGroup/PackageGroup?&lt;/a&gt; might also be confusing.
&lt;/p&gt;
&lt;p&gt;
A &lt;a class="missing wiki"&gt;PackageGroup?&lt;/a&gt; is *just* a group of packages.
&lt;/p&gt;
&lt;p&gt;
A &lt;a class="missing wiki"&gt;UserGroup?&lt;/a&gt; is both a group of users, and a thing affecting authorizations.
&lt;/p&gt;
&lt;p&gt;
Perhaps &lt;a class="missing wiki"&gt;PackageGroup?&lt;/a&gt; and &lt;a class="missing wiki"&gt;UserAuthorizationGroup?&lt;/a&gt;? Or &lt;a class="missing wiki"&gt;PackageGroup?&lt;/a&gt; and &lt;a class="missing wiki"&gt;AuthorizedUserGroup?&lt;/a&gt;?
&lt;/p&gt;
&lt;p&gt;
I was quite confused by all this at first.
&lt;/p&gt;
&lt;p&gt;
I think I understand how the whole thing works pretty well now, and I still can't think of good names for the two concepts, although I can already feel the normal English meanings of the words changing to what I now know they are for.
&lt;/p&gt;
&lt;p&gt;
We should be a little wary of this. Things that are even slightly difficult to understand end up being understood by very few people. Would any of us be prepared to sit an exam on exactly how UNIX file permissions work, even though we all use them?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>thejimmyg</dc:creator>

      <pubDate>Fri, 08 Jul 2011 13:46:39 GMT</pubDate>
      <title>summary changed</title>
      <link>http://localhost/ticket/1094#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/1094#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;summary&lt;/strong&gt;
                changed from &lt;em&gt;Refactor the Auth System&lt;/em&gt; to &lt;em&gt;[super] Refactor the Auth System&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Fri, 08 Jul 2011 14:08:34 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/1094#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/1094#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1094?action=diff&amp;amp;version=4"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>thejimmyg</dc:creator>

      <pubDate>Wed, 20 Jul 2011 14:54:09 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/1094#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/1094#comment:5</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/1065" title="enhancement: [super] Change Authorization System (closed: fixed)"&gt;#1065&lt;/a&gt; and closing.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>