def could_edit(request):
 user = getattr(request, 'user', AnonymousUser())
 return (getattr(user, 'is_superuser', False) or getattr(user, 'is_staff', False))

def could_edit ( request ) : user = getattr ( request , 'user' , AnonymousUser ( ) ) return ( getattr ( user , 'is_superuser' , False ) or getattr ( user , 'is_staff' , False ) )
return true if the context of the given request would allow xtheme editing .