I have created a new admin system on to the back of an existing website and am now on to the job of Authorization and Authentication.
I can see that any page that has this code at the top of the function, redirects to the log in page:
How can I add this to every function, without having to add it to every function?!
Adding _make_sure_allowed() Function to Every Page
4 years ago
4 years ago
#1
4 years ago
#2
Hello,
The answer is you have to have some line or lines of code that call your security measures.
So, two line for security is not much.
Create, Show, Manage
Other functions can be private. using the _ before the function name, and therefore cannot be called from outside world.
Dan
The answer is you have to have some line or lines of code that call your security measures.
So, two line for security is not much.
Create, Show, Manage
Other functions can be private. using the _ before the function name, and therefore cannot be called from outside world.
Dan
4 years ago
#3
Wouldn't it be handy to secure a whole module or directory though?
I was used to doing this in the routes with Laravel (not sure if I'm allowed to mention that word here!).
I take it there is no equivalent to this in Trongate yet...
I was used to doing this in the routes with Laravel (not sure if I'm allowed to mention that word here!).
I take it there is no equivalent to this in Trongate yet...
4 years ago
#4
Easy! Just add a constructor onto the main module class.