[ckan-changes] [okfn/ckan] f674d2: [#1184] Remove auth_sysadmins_check decorator from...

GitHub noreply at github.com
Thu Aug 22 00:21:44 UTC 2013


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: f674d2aa525daca747b8b1145858b53a06b1fec8
      https://github.com/okfn/ckan/commit/f674d2aa525daca747b8b1145858b53a06b1fec8
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-15 (Thu, 15 Aug 2013)

  Changed paths:
    M ckan/logic/auth/create.py

  Log Message:
  -----------
  [#1184] Remove auth_sysadmins_check decorator from package_create

There is no reason why sysadmins should need to use the auth function.


  Commit: 243cd1c68435fe9b121bd3ead3f774bef21dc5c8
      https://github.com/okfn/ckan/commit/243cd1c68435fe9b121bd3ead3f774bef21dc5c8
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-15 (Thu, 15 Aug 2013)

  Changed paths:
    M ckan/logic/auth/create.py
    M ckan/logic/auth/update.py
    M ckan/new_authz.py

  Log Message:
  -----------
  [#1184] Update user checks in package create and update auth functions

The `auth_is_registered_user` function's name is misleading, as it only checks
if there is a user on the Pylons context object (ie if it is logged in).
It has been renamed to `auth_is_loggedin_user`, keeping the old as
deprecated. The function is not used anymore on the auth functions, as
the user should be always present in the context dict passed to the
functions (The controller sets context['user'] to c.user).


  Commit: 1117ca25e0a675cfc9024165e412899f0615fee0
      https://github.com/okfn/ckan/commit/1117ca25e0a675cfc9024165e412899f0615fee0
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-16 (Fri, 16 Aug 2013)

  Changed paths:
    M ckan/tests/functional/test_package.py

  Log Message:
  -----------
  [#1184] Fix failing test due to not providing the user


  Commit: 11eff7eb3cfe8bc6627a84cdf45170e574a9cdb2
      https://github.com/okfn/ckan/commit/11eff7eb3cfe8bc6627a84cdf45170e574a9cdb2
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-16 (Fri, 16 Aug 2013)

  Changed paths:
    M ckan/logic/auth/create.py
    M ckan/logic/auth/update.py
    M ckan/new_authz.py

  Log Message:
  -----------
  [#1184] Revert 243cd1c with a better anon user check

Due to how the controllers set up the user in the context it was
impossible with the current logic to identify an anonymous request on
the auth functions.
On ckan/lib/base.py:232 the following are set on the pylons context object
(c):

* Anon request (not logged in):
    c.user = None
    c.author = IP (or 'Unknown IP Address')
* Logged in user:
    c.user = User name
    c.author = User name

Once in the controllers, these are normally used in:

    context = {'user': c.user or c.auhtor}

That means that once in the auth functions we need way to check if
a call is anonymous that works both for requests made via the web
(object c) or called directly from an extension, where the user is
defined directly on the context. The new `auth_is_anon_user` function
does that.

Ideally this should be handled automatically at a higher level, and the
logic layer should always work with users defined on the context object.


  Commit: 7aa597b498aea6fb8f0ca2d7f193ebafbbc7cbb9
      https://github.com/okfn/ckan/commit/7aa597b498aea6fb8f0ca2d7f193ebafbbc7cbb9
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-19 (Mon, 19 Aug 2013)

  Changed paths:
    M ckan/logic/action/create.py

  Log Message:
  -----------
  [#1184] Check if user exists before filling creator_user_id

In some cases, eg anonymous package creation, users won't actually
exist, so we need to avoid a KeyError.


  Commit: 9d2f44b2920c7e717042301916e30e3f8ed056d0
      https://github.com/okfn/ckan/commit/9d2f44b2920c7e717042301916e30e3f8ed056d0
  Author: kindly <kindly at gmail.com>
  Date:   2013-08-21 (Wed, 21 Aug 2013)

  Changed paths:
    M ckan/logic/action/create.py
    M ckan/logic/auth/create.py
    M ckan/logic/auth/update.py
    M ckan/new_authz.py
    M ckan/tests/functional/test_package.py

  Log Message:
  -----------
  Merge pull request #1184 from okfn/1184-package_create-auth-fixes

Site user can not create datasets


Compare: https://github.com/okfn/ckan/compare/306b0fbaad29...9d2f44b2920c


More information about the ckan-changes mailing list