def user_has_perm_thread(thread, profile):
 user_post = CommunicationNote.objects.filter(author=profile, thread=thread)
 user_cc = CommunicationThreadCC.objects.filter(user=profile, thread=thread)
 if (user_post.exists() or user_cc.exists()):
  return True
 if (thread.read_permission_developer and thread.check_obj_author(profile)):
  return True
 return check_acls_comm_obj(thread, profile)

def user_has_perm_thread ( thread , profile ) : user_post = CommunicationNote . objects . filter ( author = profile , thread = thread ) user_cc = CommunicationThreadCC . objects . filter ( user = profile , thread = thread ) if ( user_post . exists ( ) or user_cc . exists ( ) ) : return True if ( thread . read_permission_developer and thread . check_obj_author ( profile ) ) : return True return check_acls_comm_obj ( thread , profile )
check if the user has read/write permissions on the given thread .