I need to create access permissions on my page, but I have no idea where to start.
I installed virgin-acl
.
I have for example the page below and I want a userexample to only see:
app.get('/usuarios/novo', isLoggedIn, usuario.novo);
I would like the user ID to be verified, and if the user is allowed to view this page.
The correct one would be to use, like the following example:
acl.isAllowed('usuarioexemplo', 'usuarios', 'view', function(err, res){
if(res){
console.log("User joed is allowed to view blogs")
}
}
But where do I create these rules? No controller? No router? In the app?