def user_has_perm_note(note, profile, request=None):
 if (note.author and (note.author.id == profile.id)):
  return True
 if (request and (note.note_type == comm.REVIEWER_COMMENT)):
  return acl.check_reviewer(request)
 if (request and (note.note_type == comm.DEVELOPER_COMMENT) and acl.check_reviewer(request)):
  return True
 user_is_author = profile.addons.filter(pk=note.thread._addon_id)
 if ((user_is_author.exists() and note.read_permission_developer) or (note.note_type == comm.REVIEWER_PUBLIC_COMMENT)):
  return True
 return check_acls_comm_obj(note, profile)

def user_has_perm_note ( note , profile , request = None ) : if ( note . author and ( note . author . id == profile . id ) ) : return True if ( request and ( note . note_type == comm . REVIEWER_COMMENT ) ) : return acl . check_reviewer ( request ) if ( request and ( note . note_type == comm . DEVELOPER_COMMENT ) and acl . check_reviewer ( request ) ) : return True user_is_author = profile . addons . filter ( pk = note . thread . _addon_id ) if ( ( user_is_author . exists ( ) and note . read_permission_developer ) or ( note . note_type == comm . REVIEWER_PUBLIC_COMMENT ) ) : return True return check_acls_comm_obj ( note , profile )
check if the user has read/write permissions on the given note .