我需要檢查用戶對方法的可訪問性。如何在其他方法之前調用方法
當調用腳本的方法時,我必須檢查用戶是否有權訪問該方法。如果不是,該方法應該是return false
。
我做了一個名爲_access()
的方法來檢查可訪問性。
如何在每隔一個方法之前調用此方法。
我無法通過我自己的每種方法調用_access()
。
OBJ:
class foo{
function a()
$this->_access(); //I dont want to do this for every functions...
}
function b()
//b() should stop if _access() == false
}
function _access()
//return true or false;
//this method can backtrace and check user accessibility to caller method.
}
}
在此先感謝。
hvnt你聽說過嗎? – 2014-09-20 11:16:59