Update logic of addPermissionCheck to preserve expected behaviour in nanopay repository: Fix bug in usage of Promise.all()
Update logic of addPermissionCheck to preserve expected behaviour in nanopay repository:
Fix bug in usage of Promise.all()

Setting enabled/availablePermissions without setting permissionRequired will still invoke a permission check.

Leaving enabled/availablePermissions null and setting permissionRequired to true will compute default permissions.

Setting permissionRequired true and enabledPermissions to an empty array will _not_ invoke a permission check.

jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2