Skip to content

Commit

Permalink
docs: add note about controller_authorize_current_user vs policies
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Sep 6, 2023
1 parent 1bb9589 commit d0a99b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ApplicationController < ActionController::Base
end
```

**NOTE:** The `controller_authorize_current_user` setting only affects the way authorization context is built in controllers but does not affect policy classes configuraiton. If you inherit from `ActionPolicy::Base`, you will still have the `user` required as an authorization context. Add `authorize :user, optional: true` to your base policy class to make it optional or use a [custom base class](custom_policy.md).

> Read more about [authorization context](authorization_context.md).
If you don't want to include Action Policy in your controllers at all,
Expand Down

0 comments on commit d0a99b9

Please sign in to comment.