| 94 | |
| 95 | ==== Has Row Level Permission ==== |
| 96 | |
| 97 | The method contains_permission checks if the user has the given permission on a model (not an instance of a model but the model). This checks if there is exists the given row level permission on any of the instances of the model. It is used in the admin interface to determine if the change list should be shown to the user. |
| 98 | |
| 99 | E.g. If user A has change permission on article 234, and you did: |
| 100 | {{{ |
| 101 | #!python |
| 102 | ... |
| 103 | userA.contains_permission("mine.change_mineral", Mineral) |
| 104 | ... |
| 105 | }}} |
| 106 | It will return True. |
| 107 | |
| 108 | ''I am not a fan of contains_permission name, but for now it does work. If you have any ideas on how to change it, please let me know.'' |