コード例 #1
0
ファイル: info_test.go プロジェクト: snailwalker/juju
func (*fakeUserInfoAPI) UserInfo(usernames []string, all usermanager.IncludeDisabled) ([]params.UserInfo, error) {
	logger.Infof("fakeUserInfoAPI.UserInfo(%v, %v)", usernames, all)
	info := params.UserInfo{
		DateCreated:    dateCreated,
		LastConnection: &lastConnection,
	}
	switch usernames[0] {
	case "user-test":
		info.Username = "******"
	case "foobar":
		info.Username = "******"
		info.DisplayName = "Foo Bar"
	default:
		return nil, common.ErrPerm
	}
	return []params.UserInfo{info}, nil
}
コード例 #2
0
ファイル: info_test.go プロジェクト: kat-co/juju
func (*fakeUserInfoAPI) UserInfo(usernames []string, all usermanager.IncludeDisabled) ([]params.UserInfo, error) {
	logger.Infof("fakeUserInfoAPI.UserInfo(%v, %v)", usernames, all)
	info := params.UserInfo{
		DateCreated:    dateCreated,
		LastConnection: &lastConnection,
	}
	switch usernames[0] {
	case "current-user@local":
		info.Username = "******"
		info.Access = "addmodel"
	case "foobar":
		info.Username = "******"
		info.DisplayName = "Foo Bar"
		info.Access = "login"
	case "fred@external":
		info.Username = "******"
		info.DisplayName = "Fred External"
		info.Access = "addmodel"
	default:
		return nil, common.ErrPerm
	}
	return []params.UserInfo{info}, nil
}