本文整理汇总了Python中galaxy.util.bunch.Bunch.security_agent方法的典型用法代码示例。如果您正苦于以下问题:Python Bunch.security_agent方法的具体用法?Python Bunch.security_agent怎么用?Python Bunch.security_agent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类galaxy.util.bunch.Bunch
的用法示例。
在下文中一共展示了Bunch.security_agent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
# 需要导入模块: from galaxy.util.bunch import Bunch [as 别名]
# 或者: from galaxy.util.bunch.Bunch import security_agent [as 别名]
def init( file_path, url, engine_options={}, create_tables=False ):
"""Connect mappings to the database"""
# Load the appropriate db module
load_egg_for_url( url )
# Create the database engine
engine = create_engine( url, **engine_options )
# Connect the metadata to the database.
metadata.bind = engine
# Clear any existing contextual sessions and reconfigure
Session.remove()
Session.configure( bind=engine )
# Create tables if needed
if create_tables:
metadata.create_all()
# Pack everything into a bunch
result = Bunch( **globals() )
result.engine = engine
result.session = Session
result.create_tables = create_tables
#load local galaxy security policy
result.security_agent = CommunityRBACAgent( result )
result.shed_counter = ShedCounter( result )
return result