Exemplo n.º 1
0
    def test_list_groups_callback_with_groups(self):
        # Although group definitions are also in the user database,
        # we're not allowed to authenticate with a group id:
        get_principals()[u'bob'] = dict(name=u'bob')
        get_principals()[u'group:bobsgroup'] = dict(name=u'group:bobsgroup')

        request = DummyRequest()
        self.assertEqual(list_groups_callback(u'bob', request), [])
        self.assertEqual(
            list_groups_callback(u'group:bobsgroup', request), None)
Exemplo n.º 2
0
    def test_list_groups_callback_with_groups(self, db_session):
        from kotti.security import list_groups_callback
        from kotti.security import get_principals

        # Although group definitions are also in the user database,
        # we're not allowed to authenticate with a group id:
        get_principals()["bob"] = dict(name="bob")
        get_principals()["group:bobsgroup"] = dict(name="group:bobsgroup")

        request = DummyRequest()
        assert list_groups_callback("bob", request) == []
        assert list_groups_callback("group:bobsgroup", request) is None
Exemplo n.º 3
0
    def test_list_groups_callback_with_groups(self, db_session):
        from kotti.security import list_groups_callback
        from kotti.security import get_principals

        # Although group definitions are also in the user database,
        # we're not allowed to authenticate with a group id:
        get_principals()[u'bob'] = dict(name=u'bob')
        get_principals()[u'group:bobsgroup'] = dict(name=u'group:bobsgroup')

        request = DummyRequest()
        assert list_groups_callback(u'bob', request) == []
        assert list_groups_callback(u'group:bobsgroup', request) is None
Exemplo n.º 4
0
    def test_list_groups_callback_with_groups(self):
        from kotti.security import list_groups_callback
        from kotti.security import get_principals

        # Although group definitions are also in the user database,
        # we're not allowed to authenticate with a group id:
        get_principals()[u'bob'] = dict(name=u'bob')
        get_principals()[u'group:bobsgroup'] = dict(name=u'group:bobsgroup')

        request = DummyRequest()
        self.assertEqual(list_groups_callback(u'bob', request), [])
        self.assertEqual(list_groups_callback(u'group:bobsgroup', request),
                         None)