mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-10 00:00:26 +08:00
[系统用户]实现基础的权限校验
This commit is contained in:
@@ -6,3 +6,15 @@ 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user