Initial commit (code only without large binaries)
This commit is contained in:
23
EdgeAdmin/internal/configloaders/admin_module_list.go
Normal file
23
EdgeAdmin/internal/configloaders/admin_module_list.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package configloaders
|
||||
|
||||
import "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
|
||||
|
||||
type AdminModuleList struct {
|
||||
IsSuper bool
|
||||
Modules []*systemconfigs.AdminModule
|
||||
Fullname string
|
||||
Theme string
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user