[eluser]prestondocks[/eluser]
Hi, I am trying to impliment a security system in my application and I want to use hooks.
My plan is to use post_controller_constructor. I then want my hook method to get a data member variable in the called class. This will hold an array of methods that a guest user is able to access. The hook will then be redirected to an error page if the user is not logged in and the called method does not exist in this array.
My question is how do I get my hook method to get the data member from my called class.
Below is an example of what I am trying to do
controller code
Code:
class Meetings extends Controller
{
var $security_allow = array('book_meeting','delete_meeting','edit_meeting');
.....
}
Example below of my hook method that does not work
Code:
class Module_security
{
function module_permission()
{
$CI =& get_instance();
$called_class = $CI->router->class;
$called_method = $CI->router->method;
$mod_sec = $CI->$called_class->security_allow;
......
}
}