comparison doc/reference.txt @ 8159:3f720edd9594 permission-performance

markup fixes and word typo fix. Now passes 'make html' in website/www.
author John Rouillard <rouilj@ieee.org>
date Tue, 12 Nov 2024 11:52:40 -0500
parents 67a0fc4f9934
children f7037cb91396
comparison
equal deleted inserted replaced
8155:e9af08743759 8159:3f720edd9594
1512 The second form is preferred as it makes it easier to implement more 1512 The second form is preferred as it makes it easier to implement more
1513 complex permission schemes. An `example in upgrading.html 1513 complex permission schemes. An `example in upgrading.html
1514 <upgrading.html#enhancement-to-check-command-for-permissions>`_ 1514 <upgrading.html#enhancement-to-check-command-for-permissions>`_
1515 shows the use of ``ctx``. 1515 shows the use of ``ctx``.
1516 1516
1517 **filter 1517 **filter**
1518 A function to be executed on the results of a ``filter`` call of the 1518 A function to be executed on the results of a ``filter`` call of the
1519 schema ``Class`` before displaying the results in an ``index`` 1519 schema ``Class`` before displaying the results in an ``index``
1520 template. Calling a ``filter`` method on all results is usually faster 1520 template. Calling a ``filter`` method on all results is usually faster
1521 than calling a ``check`` method (see previous paragraph) on *each 1521 than calling a ``check`` method (see previous paragraph) on *each
1522 individual result*. The ``filter`` method has the signature:: 1522 individual result*. The ``filter`` method has the signature::
1524 filter(db, userid, klass) 1524 filter(db, userid, klass)
1525 1525
1526 where ``db`` is the database handle, ``userid`` is the user attempting 1526 where ``db`` is the database handle, ``userid`` is the user attempting
1527 access and ``klass`` is the ``Class`` in the schema. 1527 access and ``klass`` is the ``Class`` in the schema.
1528 The ``filter`` function must return a list of dictionaries of 1528 The ``filter`` function must return a list of dictionaries of
1529 parameters of the `Class.filter`` call. Results found during a query 1529 parameters of the ``Class.filter`` call. Results found during a query
1530 executed by an index template are passed through the filter calls 1530 executed by an index template are passed through the filter calls
1531 computed by the ``filter`` function. An empty list of filter 1531 computed by the ``filter`` function. An empty list of filter
1532 parameters indicates no access. Note that defining a ``filter`` 1532 parameters indicates no access. Note that defining a ``filter``
1533 function also needs the definition of a ``check`` function for 1533 function also needs the definition of a ``check`` function for
1534 checking individual items for visibility. A ``check`` function is 1534 checking individual items for visibility. A ``check`` function is
1535 manufactured automatically from a ``filter`` function in no ``check`` 1535 manufactured automatically from a ``filter`` function if no ``check``
1536 function is defined. 1536 function is defined.
1537 1537
1538 Note that the filter option is not supported for the Search 1538 Note that the filter option is not supported for the Search
1539 permission. Since the filter function is called *after* the search was 1539 permission. Since the filter function is called *after* the search was
1540 already performed a filter function does not make any sense. 1540 already performed a filter function does not make any sense.

Roundup Issue Tracker: http://roundup-tracker.org/