Example #1
0
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
}
Example #2
0
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
}