当前位置: 首页>>代码示例>>Python>>正文


Python Security.set_subject_attributes方法代码示例

本文整理汇总了Python中calvin.utilities.security.Security.set_subject_attributes方法的典型用法代码示例。如果您正苦于以下问题:Python Security.set_subject_attributes方法的具体用法?Python Security.set_subject_attributes怎么用?Python Security.set_subject_attributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在calvin.utilities.security.Security的用法示例。


在下文中一共展示了Security.set_subject_attributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: new_from_migration

# 需要导入模块: from calvin.utilities.security import Security [as 别名]
# 或者: from calvin.utilities.security.Security import set_subject_attributes [as 别名]
 def new_from_migration(self, actor_type, state, prev_connections=None, callback=None):
     """Instantiate an actor of type 'actor_type' and apply the 'state' to the actor."""
     try:
         _log.analyze(self.node.id, "+", state)
         subject_attributes = state.pop('subject_attributes', None)
         migration_info = state.pop('migration_info', None)
         try:
             state['_managed'].remove('subject_attributes')
             state['_managed'].remove('migration_info')
         except:
             pass
         if security_enabled():
             security = Security(self.node)
             security.set_subject_attributes(subject_attributes)
         else:
             security = None
         actor_def, signer = self.lookup_and_verify(actor_type, security)
         requirements = actor_def.requires if hasattr(actor_def, "requires") else []
         self.check_requirements_and_sec_policy(requirements, security, state['id'],
                                                signer, migration_info,
                                                CalvinCB(self.new, actor_type, None,
                                                         state, prev_connections,
                                                         callback=callback,
                                                         actor_def=actor_def,
                                                         security=security))
     except Exception:
         # Still want to create shadow actor.
         self.new(actor_type, None, state, prev_connections, callback=callback, shadow_actor=True)
开发者ID:f1soft,项目名称:calvin-base,代码行数:30,代码来源:actormanager.py


注:本文中的calvin.utilities.security.Security.set_subject_attributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。