diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index b2d2419cd92..feca17efaeb 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -2276,6 +2276,8 @@ def vocabulary_list(context, data_dict): :rtype: list of dictionaries ''' + _check_access('vocabulary_list', context, data_dict) + model = context['model'] vocabulary_objects = model.Session.query(model.Vocabulary).all() return model_dictize.vocabulary_list_dictize(vocabulary_objects, context) @@ -2290,6 +2292,8 @@ def vocabulary_show(context, data_dict): :rtype: dictionary ''' + _check_access('vocabulary_show', context, data_dict) + model = context['model'] vocab_id = data_dict.get('id') if not vocab_id: diff --git a/ckan/logic/auth/get.py b/ckan/logic/auth/get.py index f5e70bfa10b..dad9261ee15 100644 --- a/ckan/logic/auth/get.py +++ b/ckan/logic/auth/get.py @@ -66,6 +66,10 @@ def license_list(context, data_dict): # Licenses list is visible by default return {'success': True} +def vocabulary_list(context, data_dict): + # List of all vocabularies are visible by default + return {'success': True} + def tag_list(context, data_dict): # Tags list is visible by default return {'success': True} @@ -164,6 +168,10 @@ def group_show(context, data_dict): def organization_show(context, data_dict): return group_show(context, data_dict) +def vocabulary_show(context, data_dict): + # Allow viewing of vocabs by default + return {'success': True} + def tag_show(context, data_dict): # No authz check in the logic function return {'success': True} diff --git a/ckan/tests/test_coding_standards.py b/ckan/tests/test_coding_standards.py index 092123968ff..24c0ef9fa1e 100644 --- a/ckan/tests/test_coding_standards.py +++ b/ckan/tests/test_coding_standards.py @@ -775,8 +775,6 @@ class TestActionAuth(object): 'get: user_activity_list_html', 'get: user_followee_count', 'get: user_follower_count', - 'get: vocabulary_list', - 'get: vocabulary_show', 'update: package_relationship_update_rest', 'update: task_status_update_many', 'update: term_translation_update_many',