found it... README file.

About "One more feature in trunk...."

say you have a table with an upload field
    db.define_table('image',SQLField('file','upload'))
and the following action to allow download of the uploaded files
    def download(): return response.download(request,db)

how do you do authorization?
Now you can set

    db.image.file.authorize=lambda row: True or False

where authorize if a function that takes a row (the one containing the
image that somebody is trying to download) and determines if one is
allowed or not to download the image.

for example if you use the new Role based access control (sorry, still
undocumented). You can do

    db.image.file.authorize=lambda row: auth.has_permission
('read',db.image,row.id)

and the image can be downloaded only by those logged-in users who
belong to a group/role with 'read' permission on the entire 'image'
table or on that specific record.

Massimo


    def download(): return response.download(request,db)


On Feb 3, 7:23 pm, BearXu <[email protected]> wrote:
> Line 394 del db.table[i] should be db.table[id]
>
> Could u give us more explaination to the "One more feature in trunk...." in
> line 366?
>
> If i want to do this
> :db.define_table('mytable',db.Field('somefield'),timestamp1, timestamp2) ,
> Is that ok? If ok maybe can be added to the readme
>
> 2009/2/3 mdipierro <[email protected]>
>
>
>
> > thanks. I will fix it.
>
> > On Feb 3, 3:09 pm, Jose C <[email protected]> wrote:
> > > Hey Massimo,
>
> > > Just downloaded the above and FYI the web2py_win.zip does not have an
> > > updated README file... it still refers to version 1.55.   The
> > > web2py_src.zip has an updated one.
>
> > > Cheers,
>
> > > On Feb 3, 11:59 am, mdipierro <[email protected]> wrote:
>
> > > > Please try these...
>
> > > >http://mdp.cti.depaul.edu/examples/static/1.56rc3/web2py_src.ziphttp:.
> > ..
>
> > > > so many many changes. changelog in the README file in there.
>
> > > > Massimo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to