Exemplo n.º 1
0
def test_principals_for_user(user, principals):
    result = util.principals_for_user(user)

    if principals is None:
        assert result is None
    else:
        assert set(principals) == set(result)
Exemplo n.º 2
0
def test_principals_for_user(user, principals):
    result = util.principals_for_user(user)

    if principals is None:
        assert result is None
    else:
        assert set(principals) == set(result)
Exemplo n.º 3
0
    def groups(self):
        """Returns security principals of the logged-in user."""

        if self._userid is None:
            raise AuthTicketNotLoadedError("auth ticket is not loaded yet")

        user = self.usersvc.fetch(self._userid)
        return principals_for_user(user)
Exemplo n.º 4
0
    def groups(self):
        """Returns security principals of the logged-in user."""

        if self._userid is None:
            raise AuthTicketNotLoadedError('auth ticket is not loaded yet')

        user = self.usersvc.fetch(self._userid)
        return principals_for_user(user)