We have below methods. It generally used for User Role wise Module Permission, as per set.
In Controller: _isAllowed
In Block: _isAllowedAction
At which stage & when this method is called & what's difference between both Method?
_isAllowed for controllers is called when the controller action is dispatched. to see if the current user has access to that specific action. If not, a 403 page is displayed.
_isAllowedAction has no specific general meaning. It is declared in just 4 blocks and it is used just in that class. It is not used in parent classes or in abstract block classes.
It does a similar thing as the
_isAllowed method, it checks if the current user has access to certain actions, but it is used for displaying or not displaying certain buttons or links in the block.
For example in the admin page block it checks if the current user has access to save cms pages. If the user does not have access, then it removes the
Add button. if he does have access it just updates the button label.