mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
feat: support data initialization for groups, adapters, enforcers, plans and pricings (#2685)
This commit is contained in:
@ -96,6 +96,31 @@ func writeInitDataToFile(filePath string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
groups, err := GetGroups("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
adapters, err := GetAdapters("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
enforcers, err := GetEnforcers("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
plans, err := GetPlans("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pricings, err := GetPricings("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
data := &InitData{
|
||||
Organizations: organizations,
|
||||
Applications: applications,
|
||||
@ -112,6 +137,11 @@ func writeInitDataToFile(filePath string) error {
|
||||
Syncers: syncers,
|
||||
Tokens: tokens,
|
||||
Webhooks: webhooks,
|
||||
Groups: groups,
|
||||
Adapters: adapters,
|
||||
Enforcers: enforcers,
|
||||
Plans: plans,
|
||||
Pricings: pricings,
|
||||
}
|
||||
|
||||
text := util.StructToJsonFormatted(data)
|
||||
|
Reference in New Issue
Block a user