Can I use my function like decorator? How take access for pages?
def emailConfirmed():
    if session.abit_email is None:
        redirect(URL('default','index'))
    else:
        confirmed = 
db_xml((db_xml.abit_validation_codes.A_EMAIL==session.abit_email) & 
(db_xml.abit_validation_codes.CONFIRMED==1)).select().first()
        if confirmed is None:
            redirect(URL('default','index'))
        else:
            #Here I want to take access for pages (but don't know how)

@emailConfirmed()
def swed():
    #code

@emailConfirmed()
def docs():
    #code


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f8620cb9-cfa1-473b-b6fe-5f56a12a874f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to