Mercurial > p > roundup > code
comparison doc/upgrading.txt @ 8236:2d0bd038fc5e
doc: clarify adding ctx argument to check command in schema.py
On IRC user was unsure what file was used for the 1.51 - 1.60 upgrade
section:
Enhancement to check command for Permissions
added file name desription and example. Also marked it as optional.
Clarified that if or when it becomes required there will be a new
required upgrade direction.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 23 Dec 2024 21:10:54 -0500 |
| parents | 32aaf5dc562b |
| children | 57325fea9982 |
comparison
equal
deleted
inserted
replaced
| 8235:c41e669a655c | 8236:2d0bd038fc5e |
|---|---|
| 2883 | 2883 |
| 2884 If you haven't modified you query.item.html template, simply copy the | 2884 If you haven't modified you query.item.html template, simply copy the |
| 2885 query.item.html template from one of the above default templates to | 2885 query.item.html template from one of the above default templates to |
| 2886 your tracker's html directory. | 2886 your tracker's html directory. |
| 2887 | 2887 |
| 2888 Enhancement to check command for Permissions | 2888 Enhancement to check command for Permissions (optional) |
| 2889 -------------------------------------------- | 2889 ------------------------------------------------------- |
| 2890 | |
| 2891 A new form of check function is permitted in permission definitions. | 2890 A new form of check function is permitted in permission definitions. |
| 2892 The three argument form is still supported and will work the same | 2891 An example check function is ``own_record(db, userid, itemid)`` in the |
| 2893 as it always has (although it may be depricated in the future). | 2892 file schema.py. The three argument form is still supported and will |
| 2893 work the same as it always has (although it may be depricated in the | |
| 2894 future). | |
| 2894 | 2895 |
| 2895 If the check function is defined as:: | 2896 If the check function is defined as:: |
| 2896 | 2897 |
| 2897 check(db, userid, itemid, **ctx) | 2898 check(db, userid, itemid, **ctx) |
| 2898 | 2899 |
| 2933 | 2934 |
| 2934 It is suggested that you change your checks to use the ``**ctx`` | 2935 It is suggested that you change your checks to use the ``**ctx`` |
| 2935 parameter. This is expected to be the preferred form in the future. | 2936 parameter. This is expected to be the preferred form in the future. |
| 2936 You do not need to use the ``ctx`` parameter in the function if you do | 2937 You do not need to use the ``ctx`` parameter in the function if you do |
| 2937 not need it. | 2938 not need it. |
| 2939 | |
| 2940 If the new four argument form is required in the future, there will be | |
| 2941 required (not optional) directions on upgrading your schema. | |
| 2938 | 2942 |
| 2939 Changes to property permissions | 2943 Changes to property permissions |
| 2940 ------------------------------- | 2944 ------------------------------- |
| 2941 | 2945 |
| 2942 If you create a permission:: | 2946 If you create a permission:: |
