diff --git a/package-lock.json b/package-lock.json
index d0e1a3db8c..e3137d1169 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1778,9 +1778,9 @@
"integrity": "sha512-ePDxG9UuU9Kobk90ZUjtmDW8IT9U7aRb1/Rl9683MRNM+ur0ocHL2v7TPH2ajTiVSBUFbbeW8vKIt9jrb0JIAA=="
},
"@remixproject/engine": {
- "version": "0.2.0-alpha.4",
- "resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.0-alpha.4.tgz",
- "integrity": "sha512-AY6HaF7Y4fR1oOdz60B2zt+gGftaT5fZWSl5ka7UuDHZUzeouNMx4O1+Uk4376Mv+M3vdmpGFo6KgfsZj6wSJw=="
+ "version": "0.2.0-alpha.6",
+ "resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.0-alpha.6.tgz",
+ "integrity": "sha512-UgtFmG90wKzmsghGmvvGexj1bMjdgAPIn/del70WXX6RNfGiTxCO1a1Q/EWrFO0OJ9jXty5181zt+sJpQOoMCw=="
},
"@resolver-engine/core": {
"version": "0.3.3",
diff --git a/package.json b/package.json
index 9d475d7665..c5af7283e0 100644
--- a/package.json
+++ b/package.json
@@ -79,7 +79,7 @@
"yo-yoify": "^3.7.3"
},
"dependencies": {
- "@remixproject/engine": "^0.2.0-alpha.4",
+ "@remixproject/engine": "^0.2.0-alpha.6",
"http-server": "^0.11.1",
"remixd": "0.1.8-alpha.10",
"standard": "^8.5.0"
diff --git a/src/app/components/plugin-manager-settings.js b/src/app/components/plugin-manager-settings.js
index 88448f31b2..9185721387 100644
--- a/src/app/components/plugin-manager-settings.js
+++ b/src/app/components/plugin-manager-settings.js
@@ -49,7 +49,7 @@ export class PluginManagerSettings {
const fromLocal = window.localStorage.getItem('plugins/permissions')
this.permissions = JSON.parse(fromLocal || '{}')
this.currentSetting = this.settings()
- modalDialog('Plugin Manager Settings', this.currentSetting,
+ modalDialog('Plugin Manager Permissions', this.currentSetting,
{ fn: () => this.onValidation() },
)
}
@@ -128,7 +128,7 @@ export class PluginManagerSettings {
render () {
return yo`
`
}
diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js
index 840affca99..fc04454455 100644
--- a/src/app/files/fileManager.js
+++ b/src/app/files/fileManager.js
@@ -9,7 +9,6 @@ const toaster = require('../ui/tooltip')
const modalDialogCustom = require('../ui/modal-dialog-custom')
const helper = require('../../lib/helper.js')
import { Plugin } from '@remixproject/engine'
-import { isNative } from '../../remixAppManager.js'
import * as packageJson from '../../../package.json'
/*
@@ -173,7 +172,7 @@ class FileManager extends Plugin {
toaster.hide()
}
if (this.currentRequest) {
- const canCall = this.call('manager', 'canCall', { name: this.currentRequest.from }, this.profile, 'setFile')
+ const canCall = await this.askUserPermission('setFile', '')
if (canCall) {
this._setFileInternal(path, content)
return
diff --git a/src/app/ui/persmission-handler.js b/src/app/ui/persmission-handler.js
index 89b2a1d7af..ac5becf8a5 100644
--- a/src/app/ui/persmission-handler.js
+++ b/src/app/ui/persmission-handler.js
@@ -33,8 +33,8 @@ const css = csjs`
}
`
-function notAllowWarning (from, to) {
- return `${from.displayName || from.name} is not allowed to call ${to.displayName || to.name}.`
+function notAllowWarning (from, to, method) {
+ return `${from.displayName || from.name} is not allowed to call ${method} method of ${to.displayName || to.name}.`
}
export class PermissionHandler {
@@ -74,8 +74,8 @@ export class PermissionHandler {
{
label: 'Accept',
fn: () => {
- if (this.permissions[to.name][from.name]) {
- this.permissions[to.name][from.name] = {
+ if (this.permissions[to.name][method][from.name]) {
+ this.permissions[to.name][method][from.name] = {
allow: true,
hash: from.hash
}
@@ -87,14 +87,14 @@ export class PermissionHandler {
{
label: 'Decline',
fn: () => {
- if (this.permissions[to.name][from.name]) {
- this.permissions[to.name][from.name] = {
+ if (this.permissions[to.name][method][from.name]) {
+ this.permissions[to.name][method][from.name] = {
allow: false,
hash: from.hash
}
this.persistPermissions()
}
- reject(notAllowWarning(from, to))
+ reject(notAllowWarning(from, to, method))
}
}
)
@@ -105,17 +105,20 @@ export class PermissionHandler {
* Check if a plugin has the permission to call another plugin and askPermission if needed
* @param {PluginProfile} from the profile of the plugin that make the call
* @param {ModuleProfile} to The profile of the module that receive the call
+ * @param {string} method The name of the function to be called
+ * @param {string} message from the caller plugin to add more details if needed
* @returns {Promise ${message}Description
+
${to.description || yo`No description Provided`}
-${message}
+ ${pluginMessage}