Continuing from: https://github.com/NethServer/dev/issues/5944
@giacomo What do you think to add this in nethserver packages and show the same error (with a button Back to Dashboard) on all pages? It can complete the work NethServer team is doing on Cockpit.
beforeRouteEnter(to, from, next) {
next( vm => {
nethserver.exec(
["system-authorization/read"],
null,
null,
function(success) {
try {
success = JSON.parse(success);
} catch (e) {
console.error(e);
}
if (success.applications.indexOf(to.path.substring(1)) == -1) {
vm.view.isAuth = false; # show error form
}else{
vm.view.isAuth = true; # show normal page
}
},
function(error) {
console.error(error);
},
false
)
});
},
Have a nice week!