another strange behaviour is when @auth.requires(auth.has_membership(role = 
'Admin')) put on the function that call it, the add function didn't work

*work*
*@auth.requires(auth.has_membership(role = 'Admin')) ## here is the 
difference*
def __grid_0(flash, table):
    response.flash=T(flash)
    has_membership=auth.has_membership('Admin')
    grid=SQLFORM.smartgrid(table, onupdate=auth.archive,
                           create=has_membership,
                           editable=has_membership,
                           deletable=has_membership)
    return dict(grid=grid)

def manage_blog():
    return __grid_0(blog_manage_flash, blog_db)

*not work*
def __grid_0(flash, table):
    response.flash=T(flash)
    has_membership=auth.has_membership('Admin')
    grid=SQLFORM.smartgrid(table, onupdate=auth.archive,
                           create=has_membership,
                           editable=has_membership,
                           deletable=has_membership)
    return dict(grid=grid)

*@auth.requires(auth.has_membership(role = 'Admin'))** ## here is the 
difference*
def manage_blog():
    return __grid_0(blog_manage_flash, blog_db)

did anyone know why it like that?

thank you so much in advance

-- 

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