<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1050: refactoring of ckan/lib/authztool.py</title>
    <link>http://localhost/ticket/1050</link>
    <description>&lt;p&gt;
start looking at ckan/lib/authztool.py
&lt;/p&gt;
&lt;p&gt;
various administrative options are only available from the command line.
&lt;/p&gt;
&lt;p&gt;
This file should be refactored so that the relevant methods are callable from code, in preparations for the creation of a web gui administrative interface.
&lt;/p&gt;
&lt;p&gt;
The extracted methods should live in a new file ckan/lib/authz.py, called from authztool.py, which should do all command line parsing and printing.
&lt;/p&gt;
&lt;p&gt;
Tests should be made. There's already a file ckan/tests/test_authz.py, which looks like the appropriate place for new tests.
&lt;/p&gt;
&lt;p&gt;
all to go on a branch feature-1050-refactor-authtoolz
&lt;/p&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/1050</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>johnlawrenceaspden</dc:creator>

      <pubDate>Fri, 18 Mar 2011 12:39:21 GMT</pubDate>
      <title>status changed; owner set</title>
      <link>http://localhost/ticket/1050#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              set to &lt;em&gt;johnlawrenceaspden&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;assigned&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnlawrenceaspden</dc:creator>

      <pubDate>Fri, 18 Mar 2011 12:43:20 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1050#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:2</guid>
      <description>
        &lt;p&gt;
there's already a file ckan/tests/test_authz.py, which looks like the appropriate place for new tests.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnlawrenceaspden</dc:creator>

      <pubDate>Fri, 18 Mar 2011 12:53:23 GMT</pubDate>
      <title>type changed; keywords set</title>
      <link>http://localhost/ticket/1050#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;keywords&lt;/strong&gt;
              &lt;em&gt;refactoring&lt;/em&gt; &lt;em&gt;auth&lt;/em&gt; added
            &lt;/li&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;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Fri, 18 Mar 2011 14:27:34 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/1050#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:4</guid>
      <description>
        &lt;p&gt;
I may misunderstand how you intend to build the WUI Admin interface, but I think most of the stuff in authztool is just marshalling command line parameters anyway. The bits which do anything are factored out.
&lt;/p&gt;
&lt;p&gt;
For example, to list rights you just loop over obj_classes to call &lt;tt&gt;model.Session.query(obj_class).all()&lt;/tt&gt; and then display the values: &lt;tt&gt;type(subj).__name__, subj.name, role, type(obj).__name__, obj.name&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;
To change a right you simply call &lt;tt&gt;model.add_user_to_role(subj, role, obj)&lt;/tt&gt; or &lt;tt&gt;model.add_authorization_group_to_role(subj, role, obj)&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;
But of course if there is useful stuff to factor out then be my guest!
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnlawrenceaspden</dc:creator>

      <pubDate>Fri, 18 Mar 2011 14:42:28 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/1050#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1050?action=diff&amp;amp;version=5"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>johnlawrenceaspden</dc:creator>

      <pubDate>Fri, 18 Mar 2011 15:10:13 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/1050#comment:6</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:6</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1050?action=diff&amp;amp;version=6"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Fri, 08 Apr 2011 16:22:11 GMT</pubDate>
      <title>priority, description changed; milestone set</title>
      <link>http://localhost/ticket/1050#comment:7</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:7</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;priority&lt;/strong&gt;
                changed from &lt;em&gt;awaiting triage&lt;/em&gt; to &lt;em&gt;major&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/1050?action=diff&amp;amp;version=7"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                set to &lt;em&gt;ckan-v1.4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Fri, 08 Apr 2011 16:22:42 GMT</pubDate>
      <title>summary changed</title>
      <link>http://localhost/ticket/1050#comment:8</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:8</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;summary&lt;/strong&gt;
                changed from &lt;em&gt;refactoring of ckan/lib/authztool.py&lt;/em&gt; to &lt;em&gt;Authz lib improvement and refactor of ckan/lib/authztool.py&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>thejimmyg</dc:creator>

      <pubDate>Mon, 18 Apr 2011 09:16:28 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/1050#comment:9</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:9</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-v1.4&lt;/em&gt; to &lt;em&gt;ckan-v1.4-sprint-6&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
This should also feed into &lt;a class="closed ticket" href="http://localhost/ticket/1075" title="enhancement: Administrative dashboard - Edit Authorization related to System object (closed: fixed)"&gt;#1075&lt;/a&gt; which will be being worked on this week.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>thejimmyg</dc:creator>

      <pubDate>Fri, 08 Jul 2011 11:47:24 GMT</pubDate>
      <title>owner, milestone changed</title>
      <link>http://localhost/ticket/1050#comment:10</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:10</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;johnlawrenceaspden&lt;/em&gt; to &lt;em&gt;thejimmyg&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-v1.5&lt;/em&gt; to &lt;em&gt;ckan-backlog&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>thejimmyg</dc:creator>

      <pubDate>Wed, 20 Jul 2011 16:24:34 GMT</pubDate>
      <title>milestone deleted</title>
      <link>http://localhost/ticket/1050#comment:11</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:11</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                &lt;em&gt;ckan-backlog&lt;/em&gt; deleted
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Wed, 07 Sep 2011 11:15:17 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/1050#comment:12</link>
      <guid isPermaLink="false">http://localhost/ticket/1050#comment:12</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;assigned&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;invalid&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
There's been no objections to my comment 6 months ago saying this is invalid, so marking it invalid. Feel free to reopen if there is indeed a case here.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>