Enable CKAN Activity streams for private datasets?

503 views Asked by At

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!

2

There are 2 answers

1
manuelmatas On BEST ANSWER

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!

4
D Read On