I tried the same, now all the results are non editable, it seems I need to 
add user_login to edit permission.

I am doing the below for adding the permission, but not successful.
    auth.add_permission('edit','[email protected]', 'company', 0)

Just one more question: since this expression will return a boolean value, 
will it not either set the complete grid rows to editable or non editable 
depending upon its value. I don't know the working of the grid. Does it 
evaluates this check for each row returned by query or this condition is 
executed only once.

Thanks a lot for your help.

-Sarbjit


On Monday, March 25, 2013 2:14:28 PM UTC+5:30, 黄祥 wrote:
>
> ooopsss, sorry
>
> created_by_user=db.company.created_by == db.auth.user.id
> *should be :*
> created_by_user=db.company.created_by == auth.user<http://db.auth.user.id/>
>
> and it *work just for the query, not for editable and deletable*
>
> for your case please try (the solution is on the book):
>
> def rent():
>     grid=SQLFORM.grid(db.company, user_signature=False, 
>                       *editable = 
> auth.has_permission('edit','auth_user'), *
> *                      deletable = 
> auth.has_permission('delete','auth_user')*)
>     return locals()
>

-- 

--- 
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