def check_dataset_access_permission(view_func):
 def decorate(request, *args, **kwargs):
  dataset = kwargs.get('dataset')
  if (dataset is not None):
   dataset = Dataset.objects.can_read_or_exception(request, dataset)
  kwargs['dataset'] = dataset
  return view_func(request, *args, **kwargs)
 return wraps(view_func)(decorate)

def check_dataset_access_permission ( view_func ) : def decorate ( request , * args , ** kwargs ) : dataset = kwargs . get ( 'dataset' ) if ( dataset is not None ) : dataset = Dataset . objects . can_read_or_exception ( request , dataset ) kwargs [ 'dataset' ] = dataset return view_func ( request , * args , ** kwargs ) return wraps ( view_func ) ( decorate )
decorator ensuring that the user has access to dataset .