167 | | === s3_accessible_query === |
| 167 | === Query for Accessible Records === |
| 168 | |
| 169 | You can build a query for all records in a table which are accessible for the current user with a certain method, by using {{{auth.s3_accessible_query}}}: |
| 170 | |
| 171 | {{{ |
| 172 | # Define your query: |
| 173 | query = ... |
| 174 | |
| 175 | # Get accessible-query (e.g., all readable record in db.my_table): |
| 176 | accessible = auth.s3.accessible_query("read", db.my_table) |
| 177 | |
| 178 | # Combine both parts: |
| 179 | query = accessible & query |
| 180 | |
| 181 | # Perform the query |
| 182 | rows = db(query).select(...) |
| 183 | }}} |