diff --git a/api/types/accesslist/member.go b/api/types/accesslist/member.go index 20bdaafac10b5..6562a691b3048 100644 --- a/api/types/accesslist/member.go +++ b/api/types/accesslist/member.go @@ -24,6 +24,7 @@ import ( "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/api/types/header" "github.com/gravitational/teleport/api/types/header/convert/legacy" + "github.com/gravitational/teleport/api/utils" ) // AccessListMember is an access list member resource. @@ -116,3 +117,10 @@ func (a *AccessListMember) IsEqual(other *AccessListMember) bool { return a.Spec.Name == other.Spec.Name && a.Spec.AccessList == other.Spec.AccessList } + +// MatchSearch goes through select field values of a resource +// and tries to match against the list of search values. +func (a *AccessListMember) MatchSearch(values []string) bool { + fieldVals := append(utils.MapToStrings(a.GetAllLabels()), a.GetName()) + return types.MatchSearch(fieldVals, values, nil) +}