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)
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)
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)