def bulk_pass(context, data_dict): """TODO: Docstring for package_admin. :context: TODO :data_dict: TODO :returns: TODO """ return {'success': helpers.is_cdrc_admin()}
def __before__(self, action, **params): super(WebAdminController, self).__before__(action, **params) context = {'model': model, 'user': c.user, 'auth_user_obj': c.userobj} try: if not helpers.is_cdrc_admin(): raise logic.NotAuthorized() except logic.NotAuthorized: base.abort(401, _('Need to be CDRC website administrator to administer')) c.revision_change_state_allowed = True
def package_update(context, data_dict): if data_dict and (data_dict.get('private', '') == u'False' and not helpers.is_cdrc_admin()): return { 'success': False, 'msg': 'You do not have the permission of publishing datasets or editing published dataset.' } return ckan_auth.update.package_update(context, data_dict)
def cdrc_admin(self): """TODO: Docstring for org_admin. :returns: TODO """ if not c.user: h.redirect_to(locale=locale, controller='user', action='login', id=None) if is_cdrc_admin(): h.redirect_to( '/organization/format_review/consumer-data-research-centre') else: h.redirect_to('/dashboard')
def config_option_update(context, data_dict): return {'success': helpers.is_cdrc_admin()}