def hue_permission_required(action, app):
 def decorator(view_func):
  @wraps(view_func)
  def decorated(request, *args, **kwargs):
   if (not request.user.has_hue_permission(action, app)):
    raise PopupException((_('Permission denied (%(action)s/%(app)s).') % {'action': action, 'app': app}))
   return view_func(request, *args, **kwargs)
  return decorated
 return decorator

def hue_permission_required ( action , app ) : def decorator ( view_func ) : @ wraps ( view_func ) def decorated ( request , * args , ** kwargs ) : if ( not request . user . has_hue_permission ( action , app ) ) : raise PopupException ( ( _ ( 'Permission denied (%(action)s/%(app)s).' ) % { 'action' : action , 'app' : app } ) ) return view_func ( request , * args , ** kwargs ) return decorated return decorator
checks that the user has permissions to do action action on app app .