It's now in slices: 
http://www.web2pyslices.com/slice/show/1622/how-to-authorize-users-editing-records-only-for-records-that-were-created-by-tho

Thanks again Anthony and Steve,

Alex

On Sunday, April 28, 2013 11:37:27 AM UTC-7, Anthony wrote:
>
> Yeah, might not be a bad idea to show an explicit example like this in a 
> slice. The book only includes a note about making editable, deletable, and 
> details callables instead of booleans.
>
> Anthony
>
> On Sunday, April 28, 2013 2:28:18 PM UTC-4, Alex Glaros wrote:
>>
>> Thanks so much Anthony, it works great!
>>
>> Is this valuable enough for me to post to Slices? (I would also display 
>> the tables so that students can recreate the whole process).
>>
>> def search_shared_services():
>>          is_owner = (lambda row: row.created_by == auth.user_id) if 
>> auth.user 
>> else False 
>>          grid = SQLFORM.smartgrid(db.SharedService, linked_tables=[
>> 'SharedServicePartnerIntersection'], maxtextlength={
>> 'SharedServicePartnerIntersection.sharedServiceID':140,  
>> 'SharedService.shortSharedServiceTitle':140,
>> 'SharedService.shortSharedServiceDescription':140}, 
>> editable=is_owner,deletable
>> =is_owner, user_signature=True) 
>>          return dict(grid=grid)
>>
>>
>> Thanks,
>>
>> Alex
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to