Files
APIPark/resources/access/role.go
T
2024-08-12 21:38:09 +08:00

25 lines
311 B
Go

package access
import (
_ "embed"
"github.com/eolinker/go-common/access"
"gopkg.in/yaml.v3"
)
type Role = access.Role
var (
//go:embed role.yaml
roleData []byte
)
func init() {
ts := make(map[string][]Role)
err := yaml.Unmarshal(roleData, &ts)
if err != nil {
panic(err)
}
access.RoleAdd(ts)
}