feat: (rbac) role and user model
This commit is contained in:
parent
4afcd7c82f
commit
ee7c1cb814
|
@ -0,0 +1,22 @@
|
|||
package rbac
|
||||
|
||||
import "infini.sh/framework/core/orm"
|
||||
|
||||
type Role struct {
|
||||
orm.ORMObjectBase
|
||||
Name string `json:"name" elastic_mapping:"name:{type:keyword}"`
|
||||
Description string `json:"description" elastic_mapping:"description:{type:text}"`
|
||||
RoleType string `json:"type" elastic_mapping:"type:{type:keyword}"`
|
||||
Permission interface{} `json:"permission" elastic_mapping:"permission:{type:object}"`
|
||||
BuiltIn bool `json:"builtin" elastic_mapping:"builtin:{type:boolean}"` //是否内置
|
||||
}
|
||||
type ConsolePermission struct {
|
||||
ID string `json:"id" elastic_mapping:"id:{type:keyword}"`
|
||||
Name string `json:"name" elastic_mapping:"name:{type:keyword}"`
|
||||
}
|
||||
type ElasticsearchPermission struct {
|
||||
Cluster []string `json:"cluster" elastic_mapping:"cluster:{type:object}"`
|
||||
Index []string `json:"index" elastic_mapping:"index:{type:object}"`
|
||||
ClusterPrivilege []string `json:"cluster_privilege" elastic_mapping:"cluster_privilege:{type:object}"`
|
||||
IndexPrivilege []string `json:"index_privilege" elastic_mapping:"index_privilege:{type:object}"`
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package rbac
|
||||
|
||||
import "infini.sh/framework/core/orm"
|
||||
|
||||
type User struct {
|
||||
orm.ORMObjectBase
|
||||
Username string `json:"username" elastic_mapping:"username:{type:keyword}"`
|
||||
Password string `json:"password" elastic_mapping:"password:{type:text}"`
|
||||
Name string `json:"name" elastic_mapping:"name:{type:keyword}"`
|
||||
Phone string `json:"phone" elastic_mapping:"phone:{type:keyword}"`
|
||||
Email string `json:"email" elastic_mapping:"email:{type:keyword}"`
|
||||
}
|
Loading…
Reference in New Issue