コード例 #1
0
ファイル: util_test.py プロジェクト: luke-rm/h
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)
コード例 #2
0
ファイル: util_test.py プロジェクト: chinmaygghag/h
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)
コード例 #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)
コード例 #4
0
ファイル: auth_ticket.py プロジェクト: chinmaygghag/h
    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)