Files
EdgeAdmin/internal/configloaders/admin_module_list.go
2021-07-12 10:21:17 +08:00

23 lines
392 B
Go

package configloaders
import "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
type AdminModuleList struct {
IsSuper bool
Modules []*systemconfigs.AdminModule
Fullname string
Theme 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
}