#NEWLINE# def ensure_audit_security( perm_arg ) : #NEWLINE# #INDENT# "Decorator for web handler methods to ensure the current_user has the\n    AUDIT_SECURITY permission with the specified argument.\n\n    Args:\n        perm_arg: the argument required for the audit permission. only 'public_keys' at this point.\n    " #NEWLINE# def _wrapper( f ) : #NEWLINE# #INDENT# def _decorator( self , * args , **kwargs ) : #NEWLINE# #INDENT# if ( not any ( [ ( ( name == AUDIT_SECURITY ) and ( argument == perm_arg ) ) for ( name , argument , _ , _ ) in self . current_user . my_permissions ( ) ] ) ) : #NEWLINE# #INDENT# return self . forbidden ( ) #NEWLINE# #UNINDENT# return f ( self , * args , ** kwargs ) #NEWLINE# #UNINDENT# return wraps ( f ) ( _decorator ) #NEWLINE# #UNINDENT# return _wrapper