SimFG 69c0b2fb49
Improve the storage method of the grant info in the metastore (#18817)
Signed-off-by: SimFG <bang.fu@zilliz.com>

Signed-off-by: SimFG <bang.fu@zilliz.com>
2022-08-26 19:22:56 +08:00

21 lines
523 B
Go

package dbmodel
type Grant struct {
Base
RoleID int64 `gorm:"role_id"`
Role Role `gorm:"foreignKey:RoleID"`
Object string `gorm:"object"`
ObjectName string `gorm:"object_name"`
}
func (g *Grant) TableName() string {
return "grant"
}
//go:generate mockery --name=IGrantDb
type IGrantDb interface {
GetGrants(tenantID string, roleID int64, object string, objectName string) ([]*Grant, error)
Insert(in *Grant) error
Delete(tenantID string, roleID int64, object string, objectName string) error
}