Add auth function for harvest_source_show_status

This commit is contained in:
amercader 2013-03-18 16:48:27 +00:00
parent c76b7d95f3
commit c2a6bd14eb
2 changed files with 12 additions and 0 deletions

View File

@ -34,6 +34,7 @@ def harvest_source_show(context,data_dict):
:rtype: dictionary :rtype: dictionary
''' '''
source_dict = logic.get_action('package_show')(context, data_dict) source_dict = logic.get_action('package_show')(context, data_dict)
# For compatibility with old code, add the active field # For compatibility with old code, add the active field
@ -57,6 +58,10 @@ def harvest_source_show_status(context, data_dict):
:rtype: dictionary :rtype: dictionary
''' '''
p.toolkit.check_access('harvest_source_show_status', context, data_dict)
model = context.get('model') model = context.get('model')
source = harvest_model.HarvestSource.get(data_dict['id']) source = harvest_model.HarvestSource.get(data_dict['id'])

View File

@ -29,6 +29,13 @@ def harvest_source_show(context, data_dict):
'msg': pt._('User {0} not authorized to read harvest source {1}') 'msg': pt._('User {0} not authorized to read harvest source {1}')
.format(user, source_id)} .format(user, source_id)}
def harvest_source_show_status(context, data_dict):
'''
Authorization check for getting the status of a harvest source
It forwards the checks to harvest_source_show.
'''
return harvest_source_show(context, data_dict)
def harvest_source_list(context, data_dict): def harvest_source_list(context, data_dict):
''' '''