本文整理汇总了Python中OFS.Folder.Folder.manage_permission方法的典型用法代码示例。如果您正苦于以下问题:Python Folder.manage_permission方法的具体用法?Python Folder.manage_permission怎么用?Python Folder.manage_permission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.Folder.Folder
的用法示例。
在下文中一共展示了Folder.manage_permission方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_generateEXML_unacquired_perm_added_role
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import manage_permission [as 别名]
def test_generateEXML_unacquired_perm_added_role( self ):
ACI = 'Access contents information'
ROLES = [ 'Manager', 'Owner' ]
site = Folder(id='site').__of__(self.app)
site.manage_permission( ACI, ROLES )
configurator = self._makeOne( site ).__of__( site )
self._compareDOM( configurator.generateXML(), _UNACQUIRED_EXPORT )
示例2: test_generateEXML_unacquired_perm
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import manage_permission [as 别名]
def test_generateEXML_unacquired_perm( self ):
ACI = 'Access contents information'
ROLES = [ 'Manager', 'Owner', 'ZZZ' ]
site = Folder(id='site').__of__(self.app)
existing_roles = list( getattr( site, '__ac_roles__', [] ) )[:]
existing_roles.append( 'ZZZ' )
site.__ac_roles__ = existing_roles
site.manage_permission( ACI, ROLES )
configurator = self._makeOne( site ).__of__( site )
self._compareDOM( configurator.generateXML(), _COMBINED_EXPORT )
示例3: test_listPermissions_acquire
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import manage_permission [as 别名]
def test_listPermissions_acquire( self ):
ACI = 'Access contents information'
ROLES = [ 'Manager', 'Owner' ]
site = Folder(id='site').__of__(self.app)
site.manage_permission( ACI, ROLES, acquire=1 )
configurator = self._makeOne( site )
self.assertEqual( len( configurator.listPermissions() ), 1 )
info = configurator.listPermissions()[ 0 ]
self.assertEqual( info[ 'name' ], ACI )
self.assertEqual( info[ 'roles' ], ROLES )
self.failUnless( info[ 'acquire' ] )