manuelmatas
manuelmatas

Reputation: 251

Enable CKAN Activity streams for private datasets?

Is it possible to enable activity streams for private datasets? I've been testing and activity streams are shown for public datasets only.

I checked the /usr/lib/ckan/default/src/ckan/ckan/lib/activity_streams.py file but I couldn't find any line that checks if dataset is public or private... I thought that maybe removing that condition (if exists) would fix my problem.

I'm using CKAN 2.3 (installed form package following these steps: LINK) with Ubuntu 12.04 64bit virtual machine on Azure.

Hope you can help me with this!

Upvotes: 4

Views: 617

Answers (2)

manuelmatas
manuelmatas

Reputation: 251

I solved the issue. D Read proposal was quite close to the working answer, but the lines to comment were wrong. Despite of this, I'll give D Read a +1 for helping finding the file.

Here is the working fix:

In the activity_streams_session_extension.py file located in /usr/lib/ckan/default/src/ckan/ckan/lib (assuming CKAN 2.3 installation from source), if you want CKAN to store activity streams even if dataset is private, just comment lines 131-132 as you can see here.

In this file, datasets are treated as "packages". So you just need to comment the condition for private packages from:

# Don't create activities for private datasets.
if package.private:
    continue

to

# Don't create activities for private datasets.
#if package.private:
#    continue

Then, reload Apache and Nginx and that's it!

Upvotes: 3

D Read
D Read

Reputation: 3224

The code in question is activity_streams_session_extension.py. See:

https://github.com/ckan/ckan/blob/0f145a54629287a6f7764b8fd73963bda62260ef/ckan/lib/activity_streams_session_extension.py#L91-L93

Upvotes: 2

Related Questions