Skip to content

Commit

Permalink
[#2939] Fix admin controller for none admin redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 5, 2012
1 parent e1d172b commit e4affe7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/controllers/admin.py
Expand Up @@ -7,6 +7,7 @@
import ckan.lib.authztool
import ckan.model as model
import ckan.logic
import ckan.new_authz

from ckan.model.authz import Role
roles = Role.get_all()
Expand All @@ -27,7 +28,7 @@ def __before__(self, action, **params):
super(AdminController, self).__before__(action, **params)
context = {'model': model,
'user': c.user}
if not ckan.logic.check_access('sysadmin', context, {}):
if not ckan.new_authz.is_authorized('sysadmin', context, {})['success']:
base.abort(401, _('Need to be system administrator to administer'))
c.revision_change_state_allowed = (
c.user and self.authorizer.is_authorized(c.user,
Expand Down

0 comments on commit e4affe7

Please sign in to comment.