mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
25 lines
311 B
Go
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)
|
|
}
|