39 lines
756 B
Protocol Buffer
39 lines
756 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package user.userv1;
|
|
import "validate/validate.proto";
|
|
option go_package = "./user/userv1;userv1";
|
|
|
|
/**
|
|
* 鉴权请求
|
|
*/
|
|
service DataPrivilege {
|
|
rpc CheckDataPrivilege (ReqDataPrivilege) returns (RespDataPrivilege);
|
|
}
|
|
|
|
|
|
message RespDataPrivilege {
|
|
int32 privilegeValue = 1;
|
|
bool isAdmin = 2;
|
|
bool isMenuDataPrivilege = 3;
|
|
repeated int32 userIds = 4;
|
|
Privilege privilege = 5;
|
|
|
|
message Privilege {
|
|
bool isAll = 1;
|
|
bool isSelf = 2;
|
|
bool isDepartment = 3;
|
|
bool isDepartmentAndSub = 4;
|
|
bool isSelfAndSub = 5;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 获取数据权限
|
|
*/
|
|
message ReqDataPrivilege {
|
|
string systemName = 1;
|
|
int32 userId = 2 [(validate.rules).int32.gt = 0]; // 用户id;
|
|
string method = 3;
|
|
string path = 4;
|
|
} |