• 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 of Admin module.

    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_rules or users' roles.

    Edited by Konstantin Gerasimov
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment