Answer the question
In order to leave comments, you need to log in
What approaches do you use to generate a template with different access rights?
How clumsy is the data? Is this solution safe?
Answer the question
In order to leave comments, you need to log in
In fact, by default, the "key" of the user's role is written to res.locals in the request handler, and the template itself provides options for different roles, which - depending on the role (access rights) - are given for generation based on a simple check like if ( key == 'Admin')...
Actually, this is the same as res.render('index', {key : session.key}); , only "correct".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question