[ckan-changes] [ckan/ckan] ce103d: [#1665] Add Member factory

GitHub noreply at github.com
Thu May 1 19:19:15 UTC 2014


  Branch: refs/heads/1665-group-auth-for-any-logged-in-user
  Home:   https://github.com/ckan/ckan
  Commit: ce103db110535a32568c4ae7f6c3f44bc75f1254
      https://github.com/ckan/ckan/commit/ce103db110535a32568c4ae7f6c3f44bc75f1254
  Author: Vitor Baptista <vitor at vitorbaptista.com>
  Date:   2014-05-01 (Thu, 01 May 2014)

  Changed paths:
    M ckan/new_tests/factories.py
    M ckan/new_tests/test_factories.py

  Log Message:
  -----------
  [#1665] Add Member factory


  Commit: 385f4fefb840a7efc229f61d945835a436697e1e
      https://github.com/ckan/ckan/commit/385f4fefb840a7efc229f61d945835a436697e1e
  Author: Vitor Baptista <vitor at vitorbaptista.com>
  Date:   2014-05-01 (Thu, 01 May 2014)

  Changed paths:
    M ckan/new_tests/helpers.py

  Log Message:
  -----------
  [#1665] Add new_tests.helpers.change_config() decorator

This allows you to temporarily change a CKAN's config value during a test.
It'll restore the values to what they were before, after you test is ran.


  Commit: c57e193774e57f5ca71e793d1f85ea223d1b84f3
      https://github.com/ckan/ckan/commit/c57e193774e57f5ca71e793d1f85ea223d1b84f3
  Author: Vitor Baptista <vitor at vitorbaptista.com>
  Date:   2014-05-01 (Thu, 01 May 2014)

  Changed paths:
    M ckan/logic/action/get.py
    M ckan/new_authz.py
    M ckan/new_tests/logic/action/test_get.py
    M ckan/new_tests/test_new_authz.py
    M doc/maintaining/configuration.rst

  Log Message:
  -----------
  [#1665] Add ckan.auth.default_group_or_org_permissions config variable

This allows you to set the permissions that every user has to every group and
organization by default. This allows you to, for example, allow any user to add
a dataset to a group, simply by adding:

    ckan.auth.default_group_or_org_permissions = manage_group

To your CKAN .ini file.

In a more abstract level, what this change does it allowing you to change the
permissions to the implicit "default" role. Right now, a user can have the
"admin", "editor", and "member" roles in a group or organization. But,
implicitly, there's also a "default" role (i.e. not having a role at all).
Before this change, you couldn't change the permissions that this default role
had. Now you can.

I could've done this by making this role explicit in the
`new_authz.ROLE_PERMISSIONS` dict. I didn't do that because I wanted to allow
the user to change simply by changing the .ini file. Also, these roles are used
by the Member model to save the n-to-n relationship between users and
groups/organizations. It would probably be more complex to add a role that
wasn't supposed to be saved in the database. My solution felt simpler.


Compare: https://github.com/ckan/ckan/compare/29afd6d174f6...c57e193774e5


More information about the ckan-changes mailing list