#NEWLINE# @ classmethod #NEWLINE# def menu_personal( cls ) : #NEWLINE# #INDENT# ' Custom Personal Menu ' #NEWLINE# auth = current . auth #NEWLINE# s3 = current . response . s3 #NEWLINE# settings = current . deployment_settings #NEWLINE# if ( not auth . is_logged_in ( ) ) : #NEWLINE# #INDENT# request = current . request #NEWLINE# login_next = URL ( args = request . args , vars = request . vars ) #NEWLINE# if ( ( request . controller == 'default' ) and ( request . function == 'user' ) and ( '_next' in request . get_vars ) ) : #NEWLINE# #INDENT# login_next = request . get_vars [ '_next' ] #NEWLINE# #UNINDENT# self_registration = settings . get_security_self_registration ( ) #NEWLINE# menu_personal = MP ( ) ( MP ( 'Register' , c = 'default' , f = 'user' , m = 'register' , check = s3_has_role ) , MP ( 'Login' , c = 'default' , f = 'user' , m = 'login' , vars = dict ( _next = login_next ) ) , MP ( 'Lost Password' , c = 'default' , f = 'user' , m = 'retrieve_password' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# s3_has_role = auth . s3_has_role #NEWLINE# is_org_admin = ( lambda i : ( s3_has_role ( 'ORG_ADMIN' ) and ( not s3_has_role ( 'ADMIN' ) ) ) ) #NEWLINE# menu_personal = MP ( ) ( MP ( 'Administration' , c = 'admin' , f = 'index' , check = s3_has_role ( 'ADMIN' ) ) , MP ( 'Administration' , c = 'admin' , f = 'user' , check = is_org_admin ) , MP ( 'Profile' , c = 'default' , f = 'person' ) , MP ( 'Change Password' , c = 'default' , f = 'user' , m = 'change_password' ) , MP ( 'Logout' , c = 'default' , f = 'user' , m = 'logout' ) ) #NEWLINE# #UNINDENT# return menu_personal