You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we add permission verification, we must add if judgment in each action.
CakePHP has an advantage. In basecontroller, beforefilter can take precedence over action execution. Here, you can judge permissions and define the global variable $allowedactions = [], The action in it does not need permission. Others need to judge whether the role has access to this action. If the user has permission, beforefilter can return true or null. If there is no permission, beforefilter returns response object in the general process, such as: abstractdispatcher's handler - > initialize(); https://github.com/phalcon/cphalcon/blob/c4a804a70c9b89728f010b23935f450c79690bd7/phalcon/Dispatcher/AbstractDispatcher.zep
In the same way, judge the return value of beforefilter. If it is response, jump or display the content directly。
Although exceptions can be thrown here to intercept permissions, exceptions will be written into the error log, which increases the difficulty of troubleshooting other problems。
thanks every body
The text was updated successfully, but these errors were encountered:
If we add permission verification, we must add if judgment in each action.
CakePHP has an advantage. In basecontroller, beforefilter can take precedence over action execution. Here, you can judge permissions and define the global variable $allowedactions = [], The action in it does not need permission. Others need to judge whether the role has access to this action. If the user has permission, beforefilter can return true or null. If there is no permission, beforefilter returns response object in the general process, such as: abstractdispatcher's handler - > initialize();
https://github.com/phalcon/cphalcon/blob/c4a804a70c9b89728f010b23935f450c79690bd7/phalcon/Dispatcher/AbstractDispatcher.zep
In the same way, judge the return value of beforefilter. If it is response, jump or display the content directly。
Although exceptions can be thrown here to intercept permissions, exceptions will be written into the error log, which increases the difficulty of troubleshooting other problems。
thanks every body
The text was updated successfully, but these errors were encountered: