-
Silly question: in the task it says API calls, Why the module is Admin here? Is that because we are going to permit some actions in the Admin section?
before_action :check_access!, only: %i[index]
- can we use check_access! explicitly in the index action the way u do in other actions, since there's nothing really to DRY here? :) -
Admin
module is used to present using policy for controllers in different modules. We can restrict access for full admin module and we can override it for any other actions in controllers ofAdmin
module.Furthermore, we can use
before_action :check_access!
as a base logic and implement custom one as well for some actions. -
Custom logic for an action will be useful for specific context that based on not only
navigation_rules
or users' roles.
Please register or sign in to comment