github.com/infraboard/keyauth@v0.8.1/apps/role/pb/role.proto (about)

     1  syntax = "proto3";
     2  
     3  package infraboard.keyauth.role;
     4  option go_package = "github.com/infraboard/keyauth/apps/role";
     5  
     6  import "apps/role/pb/enum.proto";
     7  
     8  // Role is rbac's role
     9  message Role {
    10      // 角色ID
    11      // @gotags: bson:"_id" json:"id"
    12      string id = 1;
    13      // 创建时间
    14      // @gotags: bson:"create_at" json:"create_at"
    15      int64 create_at = 2;
    16      // 更新时间
    17      // @gotags: bson:"update_at" json:"update_at"
    18      int64 update_at = 3;
    19      // 角色所属域
    20      // @gotags: bson:"domain" json:"domain"
    21      string domain = 4;
    22      // 创建人
    23      // @gotags: bson:"creater" json:"creater"
    24      string creater = 5;
    25      // 角色类型
    26      // @gotags: bson:"type" json:"type"
    27      RoleType type = 6;
    28      // 应用名称
    29      // @gotags: bson:"name" json:"name"
    30      string name = 7;
    31      // 应用简单的描述
    32      // @gotags: bson:"description" json:"description"
    33      string description =8;
    34      // 角色关联的一些额外的meta信息, 比如前端视图
    35      // @gotags: bson:"meta" json:"meta"
    36      map<string, string> meta =10;
    37      // 读权限
    38      // @gotags: bson:"-" json:"permissions,omitempty"
    39      repeated Permission permissions = 9;
    40      // 范围, 角色范围限制, 由策略引擎动态补充
    41      // @gotags: bson:"-" json:"scope"
    42      string scope = 11;
    43  }
    44  
    45  // Permission 权限
    46  message Permission {
    47      // id
    48      // @gotags: bson:"_id" json:"id"
    49      string id = 1;
    50      // 关联角色ID
    51      // @gotags: bson:"role_id" json:"role_id"
    52      string role_id = 2;
    53      // 创建时间
    54      // @gotags: bson:"create_at" json:"create_at"
    55      int64 create_at = 3;
    56      // 创建人
    57      // @gotags: bson:"creater" json:"creater"
    58      string creater = 4;
    59      // 效力
    60      // @gotags: bson:"effect" json:"effect"
    61      EffectType effect = 5;
    62      // 服务ID
    63      // @gotags: bson:"service_id" json:"service_id"
    64      string service_id = 6;
    65      // 资源列表
    66      // @gotags: bson:"resource_name" json:"resource_name"
    67      string resource_name = 7;
    68      // 维度
    69      // @gotags: bson:"label_key" json:"label_key"
    70      string label_key = 8;
    71      // 适配所有值
    72      // @gotags: bson:"match_all" json:"match_all"
    73      bool match_all = 9;
    74      // 标识值
    75      // @gotags: bson:"label_values" json:"label_values"
    76      repeated string label_values = 10; 
    77      // 范围, 角色范围限制, 由策略引擎动态补充
    78      // @gotags: bson:"-" json:"scope"
    79      string scope = 11;
    80      // 权限描述
    81      // @gotags: bson:"desc" json:"desc"
    82      string desc = 12;
    83  }
    84  
    85  message Set {
    86      // @gotags: bson:"total" json:"total"
    87      int64 total = 1;
    88      // @gotags: bson:"items" json:"items"
    89      repeated Role items = 2;
    90  }
    91  
    92  // PermissionSet 用户列表
    93  message PermissionSet {
    94      // @gotags: bson:"total" json:"total"
    95      int64 total = 1;
    96      // @gotags: bson:"items" json:"items"
    97      repeated Permission items = 2;
    98  }