Skip to content

Commit

Permalink
[#2939] remove check_access_old() function
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 12, 2012
1 parent 64b1bf5 commit 9aa2463
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions ckan/logic/__init__.py
Expand Up @@ -217,28 +217,6 @@ def check_access(action, context, data_dict=None):
return True


def check_access_old(entity, action, context):
model = context['model']
user = context.get('user')
log.debug('check access - user %r, action %s' % (user, action))
if action and entity and not isinstance(entity, model.PackageRelationship):
if action != model.Action.READ and user == '':
log.debug('Valid API key needed to make changes')
return False
#raise NotAuthorized
am_authz = ckan.authz.Authorizer().is_authorized(user, action, entity)
if not am_authz:
log.debug('User is not authorized to %s %s' % (action, entity))
return False
#raise NotAuthorized
elif not user:
log.debug('No valid API key provided.')
return False
#raise NotAuthorized

log.debug('Access OK.')
return True

_actions = {}


Expand Down

0 comments on commit 9aa2463

Please sign in to comment.