コード例 #1
0
ファイル: test_rolemap.py プロジェクト: dtgit/dtedu
    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
0
ファイル: test_rolemap.py プロジェクト: dtgit/dtedu
    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
0
ファイル: test_rolemap.py プロジェクト: bendavis78/zope
    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)
コード例 #4
0
ファイル: test_rolemap.py プロジェクト: bendavis78/zope
    def test_listPermissions_no_acquire(self):

        ACI = 'Access contents information'
        ROLES = ['Manager', 'Owner']

        site = Folder(id='site').__of__(self.app)
        site.manage_permission(ACI, ROLES)
        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.failIf(info['acquire'])
コード例 #5
0
ファイル: test_rolemap.py プロジェクト: dtgit/dtedu
    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' ] )