<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #2550: User types</title>
    <link>http://localhost/ticket/2550</link>
    <description>&lt;h2 id="Requirements"&gt;Requirements&lt;/h2&gt;
&lt;p&gt;
In the data hub plugin we require the ability to differentiate users between those that have paid for a service, and those that haven't. The distinction isn't boolean as there may be levels of service for paid users, so it may be that we need a 'type' of user where there are various grades of 'paid' which are likely to be strings (specific to the data hub).
&lt;/p&gt;
&lt;h2 id="Requiredinterface"&gt;Required interface&lt;/h2&gt;
&lt;p&gt;
Once changes have been made to the user schema, for a given user we want to be able to:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;determine if they have a paid or a free account, and
&lt;/li&gt;&lt;li&gt;get a string name of the type of paid account.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
Care should be taken to ensure that the 'paid' status of the user cannot be set through the API and only by the datahub plugin.
&lt;/p&gt;
&lt;h2 id="UserStories"&gt;User Stories&lt;/h2&gt;
&lt;p&gt;
User stories related to the management, setting and changing of a user's payment level, as well as historical information on payments should be done as part of the work that includes actually allowing purchases.  For now it is adequate that we can manually control these things through paster commands.
&lt;/p&gt;
&lt;p&gt;
Payments types should be linear as I don't believe for this type of service a pick-and-mix modular model would work well. Organizations will inherit the payment level of their owner, so currently there is no requirement for it to affect organizations at all.
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;As a sysadmin I would like to be able to use a paster command to
manually set a user's payment level, or remove it entirely.
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;As a sysadmin I would like to be able to run a paster command to
view a list of users who have a payment plan, grouped by the plan
that they have.
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;As a sysadmin I would like to be able to use the API to change the
payment status of a specific user through user_create and user_update.
This shouldn't be available to anybody else.
&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;As a user, and only if I have one, I'd like to see my current payment
level on my user profile page.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
&lt;/p&gt;
&lt;h2 id="Tasks"&gt;Tasks&lt;/h2&gt;
&lt;p&gt;
[ ] Tests
&lt;/p&gt;
&lt;p&gt;
[ ] Plugin based migration
&lt;/p&gt;
&lt;p&gt;
[ ] Code
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
[ ] Model
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;
[ ] API
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
[ ] Documentation
&lt;/p&gt;
&lt;h2 id="Estimates"&gt;Estimates&lt;/h2&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/2550</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>ross</dc:creator>

      <pubDate>Mon, 25 Jun 2012 09:33:45 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/2550#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-v1.8&lt;/em&gt; to &lt;em&gt;datahub-july&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>ross</dc:creator>

      <pubDate>Mon, 25 Jun 2012 12:16:29 GMT</pubDate>
      <title>owner, status changed</title>
      <link>http://localhost/ticket/2550#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;kindly&lt;/em&gt; to &lt;em&gt;ross&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;accepted&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Clarify
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>ross</dc:creator>

      <pubDate>Tue, 26 Jun 2012 08:43:41 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/2550#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/2550?action=diff&amp;amp;version=3"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>ross</dc:creator>

      <pubDate>Tue, 26 Jun 2012 08:45:16 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/2550#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/2550?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>icmurray</dc:creator>

      <pubDate>Tue, 26 Jun 2012 17:29:33 GMT</pubDate>
      <title>owner, status changed</title>
      <link>http://localhost/ticket/2550#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;ross&lt;/em&gt; to &lt;em&gt;icmurray&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;accepted&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>icmurray</dc:creator>

      <pubDate>Tue, 26 Jun 2012 17:30:13 GMT</pubDate>
      <title>status changed</title>
      <link>http://localhost/ticket/2550#comment:6</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:6</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;accepted&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Sun, 08 Jul 2012 17:09:30 GMT</pubDate>
      <title>cc set</title>
      <link>http://localhost/ticket/2550#comment:7</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:7</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;ross&lt;/em&gt; added
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
I've done some initial work on this.  I think the best way is to define extra tables in the datahub extension.  (Rather than: using groups; or modifying the user table; or defining extras for users (in core)).
&lt;/p&gt;
&lt;p&gt;
Initially, I've created a new domain object, &lt;a class="missing wiki"&gt;PaidService?&lt;/a&gt;, which captures the different levels of account a user may have.  And then attached users to this through a secondary table.  I think the advantages of this approach are:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;the &lt;a class="missing wiki"&gt;PaidService?&lt;/a&gt; table can contain supplementary info about that account type: eg - amount of storage allowed; or cost to sign up etc...
&lt;/li&gt;&lt;li&gt;allows us to use a modular payment system if biz decide that would be favourable. ie - users belong to multiple &lt;a class="missing wiki"&gt;PaidServices?&lt;/a&gt; which are independant of one another, rather than a linear hierarcy (eg - "sign up for storage, but not for privacy" vs. "sign up for enterprise level rather than basic level")
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
The thing that's held me up today is being able to run tests: I'm having a sqlalchemy issue with defining extra mappings on the User table; which then gets dropped when initializing the test setup.  I've gotten to the bottom of the problem, and will ask kindly's advice.
&lt;/p&gt;
&lt;p&gt;
In the meantime, I could do with some user stories please.  I think I have a fairly good idea of what's likely to be needed by this ticket; but to what extent should this be exposed to a sysadmin (adding payment schemes; adding users to payment schemes; users seeing which payemtn services they're paying for (public to other users or not?); user's seeing history of payments?  sysadmins seeing list of users for each service level?) - should this be: through a dashboard?  through paster commands?  through the api? all 3?
&lt;/p&gt;
&lt;p&gt;
Do we want modular payments or a linear hierarchy of payment schemes?
&lt;/p&gt;
&lt;p&gt;
How does is this suppossed to fit in with organizations?  Do organizations purchase on behalf of users as well as individuals being able to make purchases?
&lt;/p&gt;
&lt;p&gt;
Do we need to be able to deativate a user's paid service if their payment hasn't come through?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>ross</dc:creator>

      <pubDate>Mon, 09 Jul 2012 11:31:00 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/2550#comment:8</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:8</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/2550?action=diff&amp;amp;version=8"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
I think you've nailed the user stories already, but have added them to Description to be explicit.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Tue, 17 Jul 2012 14:38:44 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/2550#comment:9</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:9</guid>
      <description>
        &lt;p&gt;
Sounds good. BTW all users stories if at all possible go in google docs now for permanence. Here is the template: &lt;a class="ext-link" href="https://docs.google.com/document/d/1U5yahDrvp_PKQMNjzI_8u3xixnALf4eNZWK2BdTXOVw/edit"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://docs.google.com/document/d/1U5yahDrvp_PKQMNjzI_8u3xixnALf4eNZWK2BdTXOVw/edit&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>icmurray</dc:creator>

      <pubDate>Thu, 19 Jul 2012 12:10:56 GMT</pubDate>
      <title>owner, priority, status, description changed</title>
      <link>http://localhost/ticket/2550#comment:10</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:10</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;icmurray&lt;/em&gt; to &lt;em&gt;ross&lt;/em&gt;
            &lt;/li&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;awaiting merge&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;accepted&lt;/em&gt; to &lt;em&gt;assigned&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/2550?action=diff&amp;amp;version=10"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Awaiting merge: &lt;a class="ext-link" href="https://github.com/okfn/ckanext-datahub/pull/1"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://github.com/okfn/ckanext-datahub/pull/1&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>ross</dc:creator>

      <pubDate>Mon, 03 Sep 2012 10:51:37 GMT</pubDate>
      <title>owner changed</title>
      <link>http://localhost/ticket/2550#comment:11</link>
      <guid isPermaLink="false">http://localhost/ticket/2550#comment:11</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;ross&lt;/em&gt; to &lt;em&gt;icmurray&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Reassigned to icmurray rather than back to backlog.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>