Last active
January 14, 2016 09:32
-
-
Save bzar/4ac06b33a210d475d92f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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