-
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? :) -
Edited by Konstantin Gerasimov
Adminmodule 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 ofAdminmodule.Furthermore, we can use
before_action :check_access!as a base logic and implement custom one as well for some actions. -
Edited by Konstantin Gerasimov
Custom logic for an action will be useful for specific context that based on not only
navigation_rulesor users' roles.
Please register or sign in to comment