Skip to content

Commit 05a8fdb

Browse files
committed
Check if Snap has permission to manage state
1 parent bbdb24b commit 05a8fdb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/snaps-controllers/src/snaps/SnapController.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,9 +1599,14 @@ export class SnapController extends BaseController<
15991599
*/
16001600
async preloadSnap(snapId: SnapId): Promise<void> {
16011601
this.#assertCanUsePlatform();
1602+
16021603
const runtime = this.#getRuntimeExpect(snapId);
1604+
const snap = this.state.snaps[snapId];
16031605

1604-
if (runtime.state !== undefined) {
1606+
if (
1607+
!snap.manifest.initialPermissions.snap_manageState ||
1608+
runtime.state !== undefined
1609+
) {
16051610
return;
16061611
}
16071612

0 commit comments

Comments
 (0)