2021-03-25 16:26:21 +00:00
|
|
|
package management
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/caos/zitadel/internal/api/authz"
|
|
|
|
features_grpc "github.com/caos/zitadel/internal/api/grpc/features"
|
|
|
|
mgmt_pb "github.com/caos/zitadel/pkg/grpc/management"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s *Server) GetFeatures(ctx context.Context, req *mgmt_pb.GetFeaturesRequest) (*mgmt_pb.GetFeaturesResponse, 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 &mgmt_pb.GetFeaturesResponse{
|
2021-11-21 19:22:25 +00:00
|
|
|
Features: features_grpc.ModelFeaturesToPb(features),
|
2021-03-25 16:26:21 +00:00
|
|
|
}, nil
|
|
|
|
}
|