2021-03-25 16:26:21 +00:00
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/caos/zitadel/internal/api/authz"
|
|
|
|
auth_pb "github.com/caos/zitadel/pkg/grpc/auth"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s *Server) ListMyZitadelFeatures(ctx context.Context, _ *auth_pb.ListMyZitadelFeaturesRequest) (*auth_pb.ListMyZitadelFeaturesResponse, error) {
|
2021-11-21 19:22:25 +00:00
|
|
|
features, err := s.query.FeaturesByOrgID(ctx, authz.GetCtxData(ctx).OrgID)
|
2021-03-25 16:26:21 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &auth_pb.ListMyZitadelFeaturesResponse{
|
2021-11-21 19:22:25 +00:00
|
|
|
Result: features.EnabledFeatureTypes(),
|
2021-03-25 16:26:21 +00:00
|
|
|
}, nil
|
|
|
|
}
|