def check_access(action, data_dict=None): from ckan.logic import check_access as check_access_logic, NotAuthorized context = {"model": model, "user": c.user or c.author} try: check_access_logic(action, context, data_dict) authorized = True except NotAuthorized: authorized = False return authorized
def check_access(action, data_dict=None): from ckan.logic import check_access as check_access_logic, NotAuthorized context = {'model': model, 'user': c.user or c.author} try: check_access_logic(action, context, data_dict) authorized = True except NotAuthorized: authorized = False return authorized
def check_access(action,data_dict=None): from ckan import model from ckan.lib.base import c from ckan.logic import check_access as check_access_logic,NotAuthorized context = {'model': model, 'user': c.user or c.author} try: check_access_logic(action,context,data_dict) authorized = True except NotAuthorized: authorized = False return authorized