1
This commit is contained in:
parent
bbb1012d13
commit
aa1b9442da
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user