[CKAN-support] Fwd: Anonymous user
Sean Hammond
sean.hammond at okfn.org
Tue Sep 24 08:42:54 UTC 2013
> It seems with CKAN 2.0, an user cannot associate groups to their
> dataset unless they have been added as a member within each group.
>
> We currently have about 27 groups and 52 users on our data site. It’s
> not practical to manually add each user to each group.
>
> Previously with 1.8, we managed this issue with the following config
> overwrite:
>
> config['ckan.default_roles.Group'] = '{"visitor": ["reader"],
> "logged_in": ["anon_editor"]}'
>
> Is there something similar with 2.0?
I'm not sure that there is a simple config option for this in 2.0.
You can write a CKAN plugin, and use the IAuthFunctions plugin interface
to allow any user to add datasets to any group. I would have to
experiment to figure out which auth function you would need to override
to achieve this, but I think either group_update or member_create.
See the tutorial here:
http://docs.ckan.org/en/latest/extensions/index.html
Alternatively, you could write a simple script using the CKAN API to add
all users to all groups. See the API docs here:
http://docs.ckan.org/en/latest/api.html
I think the API calls you would need would be user_list, group_list and
member_create:
http://docs.ckan.org/en/latest/api.html#ckan.logic.action.create.member_create
Let me know if you want more help with this.
More information about the ckan-support
mailing list