[ckan-dev] Remove user from Recent Activity

Judith Moran Judith.Moran at nt.gov.au
Fri May 3 03:34:04 UTC 2019


Hi,

Our security team want user removed from "recent activity".

They want

Dataset View test updated 22 hours ago


[cid:image001.png at 01D501B0.AE3B9570]

Hmm looks rather hard to do.

Any ideas??


I have found the following:


The main file index.html calls the method "recently_changed_packages_activity_stream".

{% set activity_stream = h.recently_changed_packages_activity_stream(limit=4) %}
{{ h.render_markdown(activity_stream,auto_link=False,allow_html=True) }}).



The file /usr/local/ckan/lib/default/src/ckan/ckan/lib/helpers.py has the definition of the method that delivers the list of activity.

@core_helper
def recently_changed_packages_activity_stream(limit=None):
    if limit:
        data_dict = {'limit': limit}
    else:
        data_dict = {}
    context = {'model': model, 'session': model.Session, 'user': c.user}
    return logic.get_action('recently_changed_packages_activity_list_html')(
        context, data_dict)


The change would involve removing the 'user':c.user from the context.

Below is the base model file that defines the above, I believe this does not need any changes

/usr/local/ckan/lib/default/src/ckan/ckan/model/activity.py

def recently_changed_packages_activity_list(limit, offset):
    '''Return the site-wide stream of recently changed package activities.

    This activity stream includes recent 'new package', 'changed package' and
    'deleted package' activities for the whole site.

    '''
    q = _changed_packages_activity_query()
    return _activities_at_offset(q, limit, offset)



Regards,


Judy Moran
Manager Data Strategy
Department of Corporate and Information Services
Northern Territory Government of Australia
T:  892 96550
E:  DataStrategy.NTG at nt.gov.au<mailto:DataStrategy.NTG at nt.gov.au>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20190503/37adc707/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 31035 bytes
Desc: image001.png
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20190503/37adc707/attachment-0001.png>


More information about the ckan-dev mailing list