This commit is contained in:
aozhiwei 2024-08-04 10:57:41 +08:00
parent bbb1012d13
commit aa1b9442da

View File

@ -41,22 +41,18 @@ func (this *PermissionTable) Load() {
this.loadUser()
}
func (this *PermissionTable) CheckAPIPermission(account string, cmd string) bool {
if account == "" || cmd == "" {
return false
}
accper, exist := this.userHash.Load(account)
func (this *PermissionTable) CheckAPIPermission(accountAddress string, cmd string) bool {
u, exist := this.userHash.Load(accountAddress)
if !exist {
return false
}
ret, exist := (*accper).api.Load(cmd)
ret, exist := (*u).api.Load(cmd)
if exist {
return *ret
}
ret, exist = (*accper).api.Load(constant.FULL_PERMISSION)
ret, exist = (*u).api.Load(constant.FULL_PERMISSION)
if exist {
return *ret
}