[ckan-changes] [okfn/ckan] 8d8829: [#943] Tweak a TODO in the docs

GitHub noreply at github.com
Tue Aug 13 14:53:34 UTC 2013


  Branch: refs/heads/943-writing-extensions-tutorial
  Home:   https://github.com/okfn/ckan
  Commit: 8d882999a5c8cb3cb4d2cfacbde16da6b0ab7d5b
      https://github.com/okfn/ckan/commit/8d882999a5c8cb3cb4d2cfacbde16da6b0ab7d5b
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-08-12 (Mon, 12 Aug 2013)

  Changed paths:
    M doc/writing-extensions.rst

  Log Message:
  -----------
  [#943] Tweak a TODO in the docs


  Commit: a72d243bb1c1d26044c58257b5194c6940756e3e
      https://github.com/okfn/ckan/commit/a72d243bb1c1d26044c58257b5194c6940756e3e
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-08-13 (Tue, 13 Aug 2013)

  Changed paths:
    M ckan/logic/__init__.py
    M ckanext/example_iauthfunctions/plugin.py
    M ckanext/example_iauthfunctions/plugin_v3.py

  Log Message:
  -----------
  [#943] Prepopulate context in check_access()

In some cases authorization functions can get called without the basics
(model, session, user) in their context dict. For example this was
happening to the group_create() auth function in the
example_iauthfunctions plugin, but only when it was called via the
templates not via the API.

This commit just changes check_access() to always put model, session and
user into the context if they aren't there already before passing the
context onto an auth function.

get_action() was already doing this for action functions.


Compare: https://github.com/okfn/ckan/compare/22d933a3ed6f...a72d243bb1c1


More information about the ckan-changes mailing list