I did added it in grid, my controller is :

@auth.requires_login()
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()


and models (db.py) are exactly same as you provided. 

It is not giving any error, but all the results are non editable. Even If I 
do login with a user 'say Manager" and add any record, it is too seen as 
non editable whereas I want the records added by a user as editable.

This line I added in my models because it seems that I haven't defined 
permission in models. 
auth.add_permission('edit','[email protected]', 'company', 0)

I can post the complete db.py as well.

Thanks
sarbjit

On Monday, March 25, 2013 3:12:03 PM UTC+5:30, 黄祥 wrote:
>
> did you add this in your grid?
>     editable = auth.has_permission('edit','auth_user'), 
>     deletable = auth.has_permission('delete','auth_user')
>
> i've already tested it before i posted and it works fine on me.
>
> in my test environment for your case i didn't add :
>     auth.add_permission('edit','[email protected]', 'company', 0)
>
> is there any error?
>
> best regards
>

-- 

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