Signal user if the networks are not supported
This commit is contained in:
parent
5e905518aa
commit
598e3217ba
|
@ -12,6 +12,7 @@ type CheckPermissionsResponse struct {
|
||||||
Satisfied bool `json:"satisfied"`
|
Satisfied bool `json:"satisfied"`
|
||||||
Permissions map[string]*PermissionTokenCriteriaResult `json:"permissions"`
|
Permissions map[string]*PermissionTokenCriteriaResult `json:"permissions"`
|
||||||
ValidCombinations []*AccountChainIDsCombination `json:"validCombinations"`
|
ValidCombinations []*AccountChainIDsCombination `json:"validCombinations"`
|
||||||
|
NetworksNotSupported bool `json:"networksNotSupported"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CheckPermissionToJoinResponse = CheckPermissionsResponse
|
type CheckPermissionToJoinResponse = CheckPermissionsResponse
|
||||||
|
@ -98,12 +99,14 @@ func (c *CheckPermissionsResponse) MarshalJSON() ([]byte, error) {
|
||||||
ValidCombinations []*AccountChainIDsCombination `json:"validCombinations"`
|
ValidCombinations []*AccountChainIDsCombination `json:"validCombinations"`
|
||||||
Roles []*HighestRoleResponse `json:"roles"`
|
Roles []*HighestRoleResponse `json:"roles"`
|
||||||
HighestRole *HighestRoleResponse `json:"highestRole"`
|
HighestRole *HighestRoleResponse `json:"highestRole"`
|
||||||
|
NetworksNotSupported bool `json:"networksNotSupported"`
|
||||||
}
|
}
|
||||||
c.calculateSatisfied()
|
c.calculateSatisfied()
|
||||||
item := &CheckPermissionsTypeAlias{
|
item := &CheckPermissionsTypeAlias{
|
||||||
Satisfied: c.Satisfied,
|
Satisfied: c.Satisfied,
|
||||||
Permissions: c.Permissions,
|
Permissions: c.Permissions,
|
||||||
ValidCombinations: c.ValidCombinations,
|
ValidCombinations: c.ValidCombinations,
|
||||||
|
NetworksNotSupported: c.NetworksNotSupported,
|
||||||
}
|
}
|
||||||
rolesAndHighestRole := calculateRolesAndHighestRole(c.Permissions)
|
rolesAndHighestRole := calculateRolesAndHighestRole(c.Permissions)
|
||||||
|
|
||||||
|
|
|
@ -236,6 +236,7 @@ func (p *DefaultPermissionChecker) CheckPermissions(permissions []*CommunityToke
|
||||||
// if there are no chain IDs that match token criteria chain IDs
|
// if there are no chain IDs that match token criteria chain IDs
|
||||||
// we aren't able to check balances on selected networks
|
// we aren't able to check balances on selected networks
|
||||||
if len(erc20ChainIDsMap) > 0 && len(chainIDsForERC20) == 0 {
|
if len(erc20ChainIDsMap) > 0 && len(chainIDsForERC20) == 0 {
|
||||||
|
response.NetworksNotSupported = true
|
||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue