File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 88 Transaction ,
99} from '@wharfkit/antelope'
1010import type { Fetch , LocaleDefinitions } from '@wharfkit/common'
11- import { SigningRequest } from '@wharfkit/signing-request'
11+ import { PlaceholderAuth , SigningRequest } from '@wharfkit/signing-request'
1212import { TransactArgs , TransactPlugin } from './transact'
1313import { WalletPlugin } from './wallet'
1414
@@ -139,6 +139,8 @@ export function extractActions(args: TransactArgs): AnyAction[] {
139139
140140/**
141141 * Check if an action has an authorization matching a given permission level.
142+ * Also matches PlaceholderAuth (actor: '............1', permission: '............2')
143+ * since placeholders will be resolved to the actual permission level.
142144 *
143145 * @param action AnyAction
144146 * @param permissionLevel PermissionLevel
@@ -148,7 +150,10 @@ export function actionMatchesPermission(
148150 action : AnyAction ,
149151 permissionLevel : PermissionLevel
150152) : boolean {
151- return action . authorization . some ( ( auth : PermissionLevelType ) => permissionLevel . equals ( auth ) )
153+ return action . authorization . some (
154+ ( auth : PermissionLevelType ) =>
155+ permissionLevel . equals ( auth ) || PlaceholderAuth . equals ( auth )
156+ )
152157}
153158
154159function rewriteAuthIfMatches (
You can’t perform that action at this time.
0 commit comments