feat: add new methods rbac for microservice transports
All checks were successful
Publish / Publish Job (push) Successful in 2m21s

This commit is contained in:
Дмитрий
2026-04-11 17:10:30 +03:00
parent 5fea4fc952
commit 29c38fd117
2 changed files with 24 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@lendry-erp/contracts",
"version": "1.2.11",
"version": "1.2.12",
"description": "Protobuf definitions and generated TypeScript types",
"type": "commonjs",
"main": "./dist/index.js",

View File

@@ -16,6 +16,10 @@ service RbacService {
rpc GetAllPermissions (GetAllPermissionsRequest) returns (GetAllPermissionsResponse);
rpc GetAllRoles(GetAllRolesRequest) returns (GetAllRolesResponse);
rpc GetUserRolesAndPermissions(GetUserRolesRequest) returns (GetUserRolesResponse);
rpc AssignRoleToUser(AssignRoleToUserRequest) returns (ModifyRoleResponse);
rpc RevokeRoleFromUser(RevokeRoleFromUserRequest) returns (ModifyRoleResponse);
}
message GetAllPermissionsRequest {
@@ -97,3 +101,22 @@ message Roles {
repeated string accounts = 6;
}
message GetUserRolesRequest {
string user_id = 1;
}
message GetUserRolesResponse {
repeated string roles = 1; // например: ["ADMIN", "MANAGER"]
repeated string permissions = 2; // например: ["users:read", "billing:write"]
int32 max_role_level = 3; // Максимальный уровень роли пользователя
}
message AssignRoleToUserRequest {
string user_id = 1;
int32 role_id = 2;
}
message RevokeRoleFromUserRequest {
string user_id = 1;
int32 role_id = 2;
}