Insert a line like the following
> def list():
> records=db(db.logs.id>0).select(orderby=~db.logs.logdate)
records=[r for r in records if t2.have_access(db.logs,r.id)]
> return dict(records=records)
This would be the slow but simple solution. there are faster ways.
Look at the source code of have_access
Mind that the new web2py will have new methods to deal with this
instead of T2.
Massimo
On Feb 2, 10:04 am, kellda <[email protected]> wrote:
> Hi
>
> I'm writing a small application where I use access control from T2.
> Now I have a list with the records an I would like to show only the
> records with the right permission (t2.have_access).
>
> def list():
> records=db(db.logs.id>0).select(orderby=~db.logs.logdate)
> return dict(records=records)
>
> and a view with {{for record in ....}}
>
> How can I do this?
>
> Thanks in advance
>
> kellda
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---