mirror of
https://github.com/varvet/pundit.git
synced 2022-11-09 12:30:11 -05:00
Merge pull request #357 from iamvery/remove-hide-action
Replace calls to `hide_action` with protected access modifier
This commit is contained in:
commit
381a39e492
2 changed files with 4 additions and 15 deletions
|
@ -128,23 +128,10 @@ module Pundit
|
|||
helper_method :pundit_policy_scope
|
||||
helper_method :pundit_user
|
||||
end
|
||||
if respond_to?(:hide_action)
|
||||
hide_action :policy
|
||||
hide_action :policy_scope
|
||||
hide_action :policies
|
||||
hide_action :policy_scopes
|
||||
hide_action :authorize
|
||||
hide_action :verify_authorized
|
||||
hide_action :verify_policy_scoped
|
||||
hide_action :permitted_attributes
|
||||
hide_action :pundit_user
|
||||
hide_action :skip_authorization
|
||||
hide_action :skip_policy_scope
|
||||
hide_action :pundit_policy_authorized?
|
||||
hide_action :pundit_policy_scoped?
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# @return [Boolean] whether authorization has been performed, i.e. whether
|
||||
# one {#authorize} or {#skip_authorization} has been called
|
||||
def pundit_policy_authorized?
|
||||
|
|
|
@ -153,6 +153,8 @@ end
|
|||
|
||||
class Controller
|
||||
include Pundit
|
||||
# Mark protected methods public so they may be called in test
|
||||
public(*Pundit.protected_instance_methods)
|
||||
|
||||
attr_reader :current_user, :params
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue