Skip to content

Commit

Permalink
fix(modify claims): compare input scope and middleware scope correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
monitz87 committed Oct 21, 2020
1 parent f8bb64b commit ea508eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/procedures/modifyClaims.ts
@@ -1,5 +1,5 @@
import { Moment } from '@polkadot/types/interfaces';
import { cloneDeep, isEqual, uniq } from 'lodash';
import { cloneDeep, isMatch, uniq } from 'lodash';
import { Claim as MeshClaim, IdentityId, TxTag, TxTags } from 'polymesh-types/types';

import { PolymeshError, Procedure } from '~/base';
Expand Down Expand Up @@ -128,7 +128,8 @@ export async function prepareModifyClaims(
let isSameScope = true;

if (isScopedClaim(claim)) {
isSameScope = isEqual(claim.scope, scope);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
isSameScope = isMatch(scope!, claim.scope);
}

return isSameScope && ClaimType[type] === claim.type;
Expand Down

0 comments on commit ea508eb

Please sign in to comment.