Files
EdgeAdmin/internal/configloaders/admin_module_list.go
2020-12-02 23:47:50 +08:00

21 lines
356 B
Go

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