diff --git a/server/adminserver/mt/Permission.go b/server/adminserver/mt/Permission.go index e469d4eb..b05828d2 100644 --- a/server/adminserver/mt/Permission.go +++ b/server/adminserver/mt/Permission.go @@ -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 }