Commit 4abd9f35 authored by Grandschtroumpf's avatar Grandschtroumpf

Permission return boolean value

parent 008399c7
...@@ -78,7 +78,7 @@ export class PermissionHandler { ...@@ -78,7 +78,7 @@ export class PermissionHandler {
} }
this.persistPermissions() this.persistPermissions()
} }
resolve() resolve(true)
} }
}, },
{ {
...@@ -105,6 +105,7 @@ export class PermissionHandler { ...@@ -105,6 +105,7 @@ export class PermissionHandler {
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
async askPermission (from, to) { async askPermission (from, to) {
try {
this.permissions = this._getFromLocal() this.permissions = this._getFromLocal()
if (!this.permissions[to.name]) this.permissions[to.name] = {} if (!this.permissions[to.name]) this.permissions[to.name] = {}
if (!this.permissions[to.name][from.name]) return this.openPermission(from, to) if (!this.permissions[to.name][from.name]) return this.openPermission(from, to)
...@@ -118,6 +119,9 @@ export class PermissionHandler { ...@@ -118,6 +119,9 @@ export class PermissionHandler {
return hash === from.hash return hash === from.hash
? true // Allow ? true // Allow
: this.openPermission(from, to) // New version of a plugin : this.openPermission(from, to) // New version of a plugin
} catch (err) {
return false
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment