rbac is added

This commit is contained in:
병준 박 2022-08-08 01:46:20 +00:00
parent 85956b6fd9
commit ea970cd9ad
9 changed files with 78 additions and 27 deletions

View File

@ -35,9 +35,12 @@ static TARGETS: Lazy<HashMap<&str, Vec<&str>>> = Lazy::new(|| {
"models",
vec![
"./proto/models/core/network.proto",
"./proto/models/domain/site.proto",
"./proto/models/rbac/resource.proto",
"./proto/models/rbac/resource_action.proto",
"./proto/models/rbac/role.proto",
"./proto/models/member/member_class.proto",
"./proto/models/member/member_level.proto",
"./proto/models/member/member_site.proto",
"./proto/models/member/member.proto",
"./proto/models/member/member_session.proto",
],

View File

@ -0,0 +1,13 @@
syntax = "proto3";
package bet.beteran.domain;
message Site {
string id = 1;
string url = 2;
bool show = 3;
bool can_use = 4;
uint64 created_at = 5;
uint64 updated_at = 6;
optional uint64 deleted_at = 7;
}

View File

@ -2,9 +2,10 @@ syntax = "proto3";
package bet.beteran.member;
import "models/domain/site.proto";
import "models/member/member_class.proto";
import "models/member/member_level.proto";
import "models/member/member_site.proto";
enum MemberState {
@ -19,20 +20,19 @@ enum MemberState {
message Member {
string id = 1;
string domain_id = 2;
bet.beteran.domain.Site site = 2;
MemberClass member_class = 3;
MemberLevel member_level = 4;
MemberSite member_site = 5;
optional Member referrer = 6;
uint64 referred_count = 7;
string username = 8;
string nickname = 9;
optional string mobile_phone_number = 10;
MemberState state = 11;
optional uint64 state_changed_at = 12;
optional string last_signined_ip = 13;
optional uint64 last_signined_at = 14;
uint64 created_at = 15;
uint64 updated_at = 16;
optional uint64 deleted_at = 17;
optional Member referrer = 5;
uint64 referred_count = 6;
string username = 7;
string nickname = 8;
optional string mobile_phone_number = 9;
MemberState state = 10;
optional uint64 state_changed_at = 11;
optional string last_signined_ip = 12;
optional uint64 last_signined_at = 13;
uint64 created_at = 14;
uint64 updated_at = 15;
optional uint64 deleted_at = 16;
}

View File

View File

@ -1,11 +0,0 @@
syntax = "proto3";
package bet.beteran.member;
message MemberSite {
string id = 1;
string url = 2;
uint64 created_at = 3;
uint64 updated_at = 4;
optional uint64 deleted_at = 5;
}

View File

@ -0,0 +1,14 @@
syntax = "proto3";
package bet.beteran.rbac;
message Resource {
string id = 1;
Resource parent = 2;
string name = 3;
string key = 4;
string description = 5;
bool can_use = 6;
uint64 created_at = 7;
uint64 updated_at = 8;
}

View File

@ -0,0 +1,16 @@
syntax = "proto3";
package bet.beteran.rbac;
import "models/rbac/resource.proto";
message ResourceAction {
string id = 1;
Resource resource = 2;
string name = 3;
string key = 4;
string description = 5;
bool can_use = 6;
uint64 created_at = 7;
uint64 updated_at = 8;
}

View File

@ -0,0 +1,16 @@
syntax = "proto3";
package bet.beteran.rbac;
import "models/rbac/resource.proto";
message Role {
string id = 1;
Role parent = 2;
string name = 3;
string key = 4;
string description = 5;
bool can_use = 6;
uint64 created_at = 7;
uint64 updated_at = 8;
}