def restricted_content(f):
 @functools.wraps(f)
 def wrapper(request, *args, **kw):
  from olympia.access import acl
  if (acl.action_allowed(request, '*', '*') or (not acl.action_allowed(request, 'Restricted', 'UGC'))):
   return f(request, *args, **kw)
  else:
   raise PermissionDenied
 return wrapper

def restricted_content ( f ) : @ functools . wraps ( f ) def wrapper ( request , * args , ** kw ) : from olympia . access import acl if ( acl . action_allowed ( request , '*' , '*' ) or ( not acl . action_allowed ( request , 'Restricted' , 'UGC' ) ) ) : return f ( request , * args , ** kw ) else : raise PermissionDenied return wrapper
prevent access to a view function for accounts restricted from posting user-generated content .