# HG changeset patch # User John Rouillard # Date 1732112888 18000 # Node ID d3a1094b15eb7948d7dff3211235db5ca35fce85 # Parent f7037cb913965b30d44288041e523af84d59028c unwrap examples; clarify text some examples were overflowing the box when displayed as html. Reformat to prevent overflow/wrap. Also clarify some example text. diff -r f7037cb91396 -r d3a1094b15eb doc/reference.txt --- a/doc/reference.txt Wed Nov 20 09:26:13 2024 -0500 +++ b/doc/reference.txt Wed Nov 20 09:28:08 2024 -0500 @@ -1549,7 +1549,9 @@ in the query checks above would look like:: def filter_query(db, userid, klass): - return [{'filterspec': {'private_for': ['-1', userid]}}] + return [{'filterspec': { + 'private_for': ['-1', userid] + }}] This would be called by the framework for all queries found when displaying queries. It filters for all queries where the @@ -1570,10 +1572,11 @@ "or" condition, the user has access if either the ``private_for`` check passes *or* the user is the creator of the query. - Now consider an example where we have a class ``organisation`` and the - ``issue`` class has a ``Link`` to ``organisation`` as has the ``user`` - class. Users may only see issues that belong to their own - ``organisation``. A ``check`` function for this would be:: + Consider an example where we have a class structure where both the + ``issue`` class and the ``user`` class include a reference to an + ``organization`` class. Users are permitted to view only those + issues that are associated with their respective organizations. A + check function or this could look like:: def view_issue(db, userid, itemid): user = db.user.getnode(userid) @@ -1589,7 +1592,9 @@ user = db.user.getnode(userid) if not user.organisation: return [] - return [{'filterspec': {'organisation': user.organisation}}] + return [{'filterspec': { + 'organisation': user.organisation + }}] This filters for all issues where the organisation is the same as the organisation of the user. Note how the filter fails early returning an