1
This commit is contained in:
parent
bbb1012d13
commit
aa1b9442da
@ -41,22 +41,18 @@ func (this *PermissionTable) Load() {
|
|||||||
this.loadUser()
|
this.loadUser()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PermissionTable) CheckAPIPermission(account string, cmd string) bool {
|
func (this *PermissionTable) CheckAPIPermission(accountAddress string, cmd string) bool {
|
||||||
if account == "" || cmd == "" {
|
u, exist := this.userHash.Load(accountAddress)
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
accper, exist := this.userHash.Load(account)
|
|
||||||
if !exist {
|
if !exist {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
ret, exist := (*accper).api.Load(cmd)
|
ret, exist := (*u).api.Load(cmd)
|
||||||
if exist {
|
if exist {
|
||||||
return *ret
|
return *ret
|
||||||
}
|
}
|
||||||
|
|
||||||
ret, exist = (*accper).api.Load(constant.FULL_PERMISSION)
|
ret, exist = (*u).api.Load(constant.FULL_PERMISSION)
|
||||||
if exist {
|
if exist {
|
||||||
return *ret
|
return *ret
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user