func (key *APIKeyType) HasPermission(perm string, addrHash *hash.Hash) bool {
	if key.Admin {
		return true
	}

	perm = strings.ToLower(perm)

	for _, p := range key.Permissions {
		if strings.ToLower(p) == perm && (addrHash == nil || addrHash.String() == key.AddressHash.String()) {
			return true
		}
	}

	return false
}
// HasPermission returns true when this key contains the given permission, or when the key is an admin key (granted all permissions)
HasPermission returns true when this key contains the given permission, or when the key is an admin key (granted all permissions)
// HasPermission returns true when this key contains the given permission or when the key is an admin key ( granted all permissions )
func (key *APIKeyType) HasPermission(perm string, addrHash *hash.Hash) bool {
	if key.Admin {
		return true
	}
	perm = strings.ToLower(perm)
	for _, p := range key.Permissions {
		if strings.ToLower(p) == perm && (addrHash == nil || addrHash.String() == key.AddressHash.String()) {
			return true
		}
	}
	return false
}
func ( key * APIKeyType ) HasPermission ( perm string , addrHash * hash . Hash ) bool { if key . Admin { return true } perm = strings . ToLower ( perm ) for _ , p := range key . Permissions { if strings . ToLower ( p ) == perm && ( addrHash == nil || addrHash . String ( ) == key . AddressHash . String ( ) ) { return true } } return false }
HasPermission returns true when this key contains the given permission, or when the key is an admin key (granted all permissions)
HasPermission returns true when this key contains the given permission or when the key is an admin key ( granted all permissions )