This commit is contained in:
@@ -15,4 +15,9 @@ service InternalAuthorizationService {
|
||||
rpc InitPermissionsForRoutes(InternalInitRoutesReq) returns (base.v1.StatusRes) {}
|
||||
rpc GetUserIdentityBasic(GetUserReq) returns (UserIdentityBasic) {}
|
||||
rpc GetUserIAM(GetUserReq) returns (InternalIAM) {}
|
||||
rpc ListRoles(InternalRoleListReq) returns (RoleList) {}
|
||||
rpc ListPermissions(InternalPermissionListReq) returns (PermissionList) {}
|
||||
rpc CreateRoleAndAssign(CreateRoleAndAssignReq) returns (InternalIAM) {}
|
||||
rpc AssignRoleToUser(AssignRoleToUserReq) returns (InternalIAM) {}
|
||||
rpc AssignPermissionToUser(AssignPermissionToUserReq) returns (InternalIAM) {}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,44 @@ message PermissionList {
|
||||
uint32 total_count = 4;
|
||||
}
|
||||
|
||||
message RoleList {
|
||||
repeated Role list = 1;
|
||||
uint32 total_count = 2;
|
||||
}
|
||||
|
||||
message InternalRoleListReq {
|
||||
string type = 1;
|
||||
}
|
||||
|
||||
message InternalPermissionListReq {
|
||||
int64 role_id = 1;
|
||||
}
|
||||
|
||||
message CreateRoleAndAssignReq {
|
||||
int64 user_id = 1;
|
||||
string title = 2;
|
||||
string key = 3;
|
||||
string type = 4;
|
||||
int64 parent_id = 5;
|
||||
repeated int64 permission_ids = 6;
|
||||
}
|
||||
|
||||
message AssignRoleToUserReq {
|
||||
int64 user_id = 1;
|
||||
int64 role_id = 2;
|
||||
bool assigned = 3;
|
||||
}
|
||||
|
||||
// Users only carry role IDs in the authorization schema. When role_id is
|
||||
// omitted, the service creates a private role for this user and grants the
|
||||
// requested permission through that role.
|
||||
message AssignPermissionToUserReq {
|
||||
int64 user_id = 1;
|
||||
int64 permission_id = 2;
|
||||
int64 role_id = 3;
|
||||
bool assigned = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
UserSendOtp
|
||||
*/
|
||||
@@ -132,6 +170,7 @@ message User {
|
||||
UserStatus status = 5;
|
||||
repeated int64 roles = 6;
|
||||
int64 referrer_user_id = 7;
|
||||
string referral_code = 8;
|
||||
}
|
||||
|
||||
message UserAddress {
|
||||
|
||||
Reference in New Issue
Block a user