generated from VLADIMIR/template
add permissions rules
This commit is contained in:
@@ -424,6 +424,9 @@ service EveningDetectiveServer {
|
|||||||
get: "/api/teams/{id}/actions"
|
get: "/api/teams/{id}/actions"
|
||||||
};
|
};
|
||||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
|
security: {
|
||||||
|
security_requirement: {}
|
||||||
|
}
|
||||||
tags : "Ходы";
|
tags : "Ходы";
|
||||||
summary: "Получить ходы";
|
summary: "Получить ходы";
|
||||||
};
|
};
|
||||||
@@ -435,6 +438,9 @@ service EveningDetectiveServer {
|
|||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||||
|
security: {
|
||||||
|
security_requirement: {}
|
||||||
|
}
|
||||||
tags : "Ходы";
|
tags : "Ходы";
|
||||||
summary: "Сделать ход";
|
summary: "Сделать ход";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ func main() {
|
|||||||
"/crabs.evening_detective_server.EveningDetectiveServer/DownloadFile": true,
|
"/crabs.evening_detective_server.EveningDetectiveServer/DownloadFile": true,
|
||||||
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenario": true,
|
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenario": true,
|
||||||
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenariosCatalog": true,
|
"/crabs.evening_detective_server.EveningDetectiveServer/GetScenariosCatalog": true,
|
||||||
|
"/crabs.evening_detective_server.EveningDetectiveServer/GetTeamActions": true,
|
||||||
|
"/crabs.evening_detective_server.EveningDetectiveServer/AddTeamAction": true,
|
||||||
},
|
},
|
||||||
processorJWT,
|
processorJWT,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -931,6 +931,11 @@
|
|||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"Ходы"
|
"Ходы"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"": []
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
@@ -969,6 +974,11 @@
|
|||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"Ходы"
|
"Ходы"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"": []
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -540,18 +540,38 @@ func (s *server) UpdateGame(ctx context.Context, req *proto.UpdateGameReq) (*pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) AddTeam(ctx context.Context, req *proto.AddTeamReq) (*proto.AddTeamRsp, error) {
|
func (s *server) AddTeam(ctx context.Context, req *proto.AddTeamReq) (*proto.AddTeamRsp, error) {
|
||||||
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
|
if !roles.HasRole(claims, roles.Organizer) {
|
||||||
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) UpdateTeam(ctx context.Context, req *proto.UpdateTeamReq) (*proto.UpdateTeamRsp, error) {
|
func (s *server) UpdateTeam(ctx context.Context, req *proto.UpdateTeamReq) (*proto.UpdateTeamRsp, error) {
|
||||||
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
|
if !roles.HasRole(claims, roles.Organizer) {
|
||||||
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) DeleteTeam(ctx context.Context, req *proto.DeleteTeamReq) (*proto.DeleteTeamRsp, error) {
|
func (s *server) DeleteTeam(ctx context.Context, req *proto.DeleteTeamReq) (*proto.DeleteTeamRsp, error) {
|
||||||
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
|
if !roles.HasRole(claims, roles.Organizer) {
|
||||||
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) GiveTeamApplications(ctx context.Context, req *proto.GiveTeamApplicationsReq) (*proto.GiveTeamApplicationsRsp, error) {
|
func (s *server) GiveTeamApplications(ctx context.Context, req *proto.GiveTeamApplicationsReq) (*proto.GiveTeamApplicationsRsp, error) {
|
||||||
|
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||||
|
if !roles.HasRole(claims, roles.Organizer) {
|
||||||
|
return nil, status.Errorf(codes.PermissionDenied, "permission denied")
|
||||||
|
}
|
||||||
|
|
||||||
panic("unimplemented")
|
panic("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -4294,7 +4294,7 @@ const file_main_proto_rawDesc = "" +
|
|||||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
|
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
|
||||||
"\x04code\x18\x02 \x01(\tR\x04code\"(\n" +
|
"\x04code\x18\x02 \x01(\tR\x04code\"(\n" +
|
||||||
"\x10AddTeamActionRsp\x12\x14\n" +
|
"\x10AddTeamActionRsp\x12\x14\n" +
|
||||||
"\x05error\x18\x01 \x01(\tR\x05error2\x88<\n" +
|
"\x05error\x18\x01 \x01(\tR\x05error2\x98<\n" +
|
||||||
"\x16EveningDetectiveServer\x12\xa6\x01\n" +
|
"\x16EveningDetectiveServer\x12\xa6\x01\n" +
|
||||||
"\x04Ping\x12'.crabs.evening_detective_server.PingReq\x1a'.crabs.evening_detective_server.PingRsp\"L\x92A3\x12)Проверить доступностьb\x06\n" +
|
"\x04Ping\x12'.crabs.evening_detective_server.PingReq\x1a'.crabs.evening_detective_server.PingRsp\"L\x92A3\x12)Проверить доступностьb\x06\n" +
|
||||||
"\x04\n" +
|
"\x04\n" +
|
||||||
@@ -4386,11 +4386,15 @@ const file_main_proto_rawDesc = "" +
|
|||||||
"DeleteTeam\x12-.crabs.evening_detective_server.DeleteTeamReq\x1a-.crabs.evening_detective_server.DeleteTeamRsp\"I\x92A/\n" +
|
"DeleteTeam\x12-.crabs.evening_detective_server.DeleteTeamReq\x1a-.crabs.evening_detective_server.DeleteTeamRsp\"I\x92A/\n" +
|
||||||
"\x0eКоманда\x12\x1dУдалить команду\x82\xd3\xe4\x93\x02\x11*\x0f/api/teams/{id}\x12\xdd\x01\n" +
|
"\x0eКоманда\x12\x1dУдалить команду\x82\xd3\xe4\x93\x02\x11*\x0f/api/teams/{id}\x12\xdd\x01\n" +
|
||||||
"\x14GiveTeamApplications\x127.crabs.evening_detective_server.GiveTeamApplicationsReq\x1a7.crabs.evening_detective_server.GiveTeamApplicationsRsp\"S\x92A)\n" +
|
"\x14GiveTeamApplications\x127.crabs.evening_detective_server.GiveTeamApplicationsReq\x1a7.crabs.evening_detective_server.GiveTeamApplicationsRsp\"S\x92A)\n" +
|
||||||
"\x0eКоманда\x12\x17Выдать улику\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/api/teams/{id}/applications\x12\xbf\x01\n" +
|
"\x0eКоманда\x12\x17Выдать улику\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/api/teams/{id}/applications\x12\xc7\x01\n" +
|
||||||
"\x0eGetTeamActions\x121.crabs.evening_detective_server.GetTeamActionsReq\x1a1.crabs.evening_detective_server.GetTeamActionsRsp\"G\x92A%\n" +
|
"\x0eGetTeamActions\x121.crabs.evening_detective_server.GetTeamActionsReq\x1a1.crabs.evening_detective_server.GetTeamActionsRsp\"O\x92A-\n" +
|
||||||
"\bХоды\x12\x19Получить ходы\x82\xd3\xe4\x93\x02\x19\x12\x17/api/teams/{id}/actions\x12\xbb\x01\n" +
|
"\bХоды\x12\x19Получить ходыb\x06\n" +
|
||||||
"\rAddTeamAction\x120.crabs.evening_detective_server.AddTeamActionReq\x1a0.crabs.evening_detective_server.AddTeamActionRsp\"F\x92A!\n" +
|
"\x04\n" +
|
||||||
"\bХоды\x12\x15Сделать ход\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/api/teams/{id}/actionsB\xd7\x01\x92A\xc8\x01\x12U\n" +
|
"\x00\x12\x00\x82\xd3\xe4\x93\x02\x19\x12\x17/api/teams/{id}/actions\x12\xc3\x01\n" +
|
||||||
|
"\rAddTeamAction\x120.crabs.evening_detective_server.AddTeamActionReq\x1a0.crabs.evening_detective_server.AddTeamActionRsp\"N\x92A)\n" +
|
||||||
|
"\bХоды\x12\x15Сделать ходb\x06\n" +
|
||||||
|
"\x04\n" +
|
||||||
|
"\x00\x12\x00\x82\xd3\xe4\x93\x02\x1c:\x01*\"\x17/api/teams/{id}/actionsB\xd7\x01\x92A\xc8\x01\x12U\n" +
|
||||||
"KДокументация сервиса \"Вечерний детектив\"2\x06v0.1.0Z]\n" +
|
"KДокументация сервиса \"Вечерний детектив\"2\x06v0.1.0Z]\n" +
|
||||||
"[\n" +
|
"[\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
|
|||||||
Reference in New Issue
Block a user