def _linkto(self, r, authorised=None, update=None, native=False):
        """
            Returns a linker function for the record ID column in list views

            @param r: the S3Request
            @param authorised: user authorised for update
                (override internal check)
            @param update: provide link to update rather than to read
            @param native: link to the native controller rather than to
                component controller
        """

        c = None
        f = None

        s3db = current.s3db

        prefix, name, table, tablename = r.target()
        permit = current.auth.s3_has_permission

        if authorised is None:
            authorised = permit("update", tablename)

        if authorised and update:
            linkto = s3db.get_config(tablename, "linkto_update", None)
        else:
            linkto = s3db.get_config(tablename, "linkto", None)

        if r.component and native:
            # link to native component controller (be sure that you have one)
            c = prefix
            f = name

        if r.representation == "iframe":
            if current.deployment_settings.get_ui_iframe_opens_full():
                iframe_safe = lambda url: s3_set_extension(url, "html")
            else:
                iframe_safe = lambda url: s3_set_extension(url, "iframe")
        else:
            iframe_safe = False

        def list_linkto(record_id, r=r, c=c, f=f,
                        linkto=linkto,
                        update=authorised and update):

            if linkto:
                try:
                    url = str(linkto(record_id))
                except TypeError:
                    url = linkto % record_id
            else:
                if r.component:
                    if r.link and not r.actuate_link():
                        # We're rendering a link table here, but must
                        # however link to the component record IDs
                        if str(record_id).isdigit():
                            # dataTables uses the value in the ID column
                            # to render action buttons, so we replace that
                            # value by the component record ID using .represent
                            _id = r.link.table._id
                            _id.represent = lambda opt, \
                                                   link=r.link, master=r.id: \
                                                   link.component_id(master, opt)
                            # The native link behind the action buttons uses
                            # record_id, so we replace that too just in case
                            # the action button cannot be displayed
                            record_id = r.link.component_id(r.id, record_id)
                    if c and f:
                        args = [record_id]
                    else:
                        c = r.controller
                        f = r.function
                        args = [r.id, r.component_name, record_id]
                    if update:
                        url = str(URL(r=r, c=c, f=f,
                                      args=args + ["update"],
                                      # Don't forward all vars unconditionally
                                      #vars=r.get_vars
                                      ))
                    else:
                        url = str(URL(r=r, c=c, f=f,
                                      args=args + ["read"],
                                      # Don't forward all vars unconditionally
                                      #vars=r.get_vars
                                      ))
                else:
                    args = [record_id]
                    # Don't forward get_vars, except "viewing"
                    get_vars = Storage()
                    if "viewing" in r.get_vars:
                        get_vars.viewing = r.get_vars["viewing"]
                    if update:
                        url = str(URL(r=r, c=c, f=f,
                                      args = args + ["update"],
                                      vars = get_vars
                                      ))
                    else:
                        url = str(URL(r=r, c=c, f=f,
                                      args = args + ["read"],
                                      vars = get_vars
                                      ))
            if iframe_safe:
                url = iframe_safe(url)
            return url

        return list_linkto

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3crud.py/S3CRUD._linkto/original