Files
EdgeAdmin/internal/configloaders/admin_module_list.go

24 lines
409 B
Go
Raw Permalink Normal View History

package configloaders
import "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
type AdminModuleList struct {
2020-12-07 11:45:45 +08:00
IsSuper bool
Modules []*systemconfigs.AdminModule
Fullname string
2021-07-12 10:21:17 +08:00
Theme string
2023-06-28 09:14:07 +08:00
Lang string
}
func (this *AdminModuleList) Allow(module string) bool {
if this.IsSuper {
return true
}
for _, m := range this.Modules {
if m.Code == module {
return true
}
}
return false
}