Skip to content

Instantly share code, notes, and snippets.

@bzar
Last active January 14, 2016 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzar/4ac06b33a210d475d92f to your computer and use it in GitHub Desktop.
Save bzar/4ac06b33a210d475d92f to your computer and use it in GitHub Desktop.
import ckan.plugins as plugins
import logging
log = logging.getLogger(__name__)
def admin_only(context, data_dict=None):
return {'success': False, 'msg': 'Access restricted to system administrators'}
class Apicatalog_RoutesPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IAuthFunctions)
# IAuthFunctions
def get_auth_functions(self):
return {'user_list', admin_only
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment