generated from VLADIMIR/template
add catalog
This commit is contained in:
@@ -242,6 +242,19 @@ func (s *server) GetMyScenarios(ctx context.Context, req *proto.GetMyScenariosRe
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetScenariosCatalog(ctx context.Context, req *proto.GetScenariosCatalogReq) (*proto.GetScenariosCatalogRsp, error) {
|
||||
scenarios, err := s.scenarioService.GetScenariosCatalog(ctx)
|
||||
if err != nil {
|
||||
return &proto.GetScenariosCatalogRsp{
|
||||
Error: err.Error(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return &proto.GetScenariosCatalogRsp{
|
||||
Scenarios: mapScenarios(scenarios),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *server) GetScenario(ctx context.Context, req *proto.GetScenarioReq) (*proto.GetScenarioRsp, error) {
|
||||
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||
if !roles.HasRole(claims, roles.Author) {
|
||||
|
||||
Reference in New Issue
Block a user