zitadel/pkg/grpc/management/changes.go
Livio Spring 5bd9badbcf
fix: project grants (#4031)
* fix: filter granted memberships correctly

* fix: only show changes of granted project

* Apply suggestions from code review

Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>

* Update internal/query/user_membership.go

Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>

Co-authored-by: Fabi <38692350+hifabienne@users.noreply.github.com>
2022-07-27 07:55:44 +00:00

50 lines
1.1 KiB
Go

package management
import (
"github.com/zitadel/zitadel/internal/api/grpc/server/middleware"
"github.com/zitadel/zitadel/pkg/grpc/change"
)
func (c *ListUserChangesResponse) Localizers() []middleware.Localizer {
if c == nil {
return nil
}
return changesLocalizers(c.Result)
}
func (c *ListOrgChangesResponse) Localizers() []middleware.Localizer {
if c == nil {
return nil
}
return changesLocalizers(c.Result)
}
func (c *ListProjectChangesResponse) Localizers() []middleware.Localizer {
if c == nil {
return nil
}
return changesLocalizers(c.Result)
}
func (c *ListProjectGrantChangesResponse) Localizers() []middleware.Localizer {
if c == nil {
return nil
}
return changesLocalizers(c.Result)
}
func (c *ListAppChangesResponse) Localizers() []middleware.Localizer {
if c == nil {
return nil
}
return changesLocalizers(c.Result)
}
func changesLocalizers(changes []*change.Change) []middleware.Localizer {
localizers := make([]middleware.Localizer, len(changes))
for i, change := range changes {
localizers[i] = change.EventType
}
return localizers
}