Skip to content

Commit

Permalink
Fix out-of-date yard tags in Pundit::Context
Browse files Browse the repository at this point in the history
These are a remnant from the first pass when introducing Pundit::Context.
  • Loading branch information
Burgestrand committed Oct 9, 2024
1 parent 28a34c1 commit 993efc3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/pundit/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Pundit
# Pundit::Context is intended to be created once per request and user, and
# it is then used to perform authorization checks throughout the request.
class Context
# @param user [Object] later passed to policies and scopes
# @param policy_cache [#fetch] cache store for policies (see e.g. {CacheStore::NullStore})
def initialize(user:, policy_cache: CacheStore::NullStore.instance)
@user = user
@policy_cache = policy_cache
Expand All @@ -18,7 +20,6 @@ def initialize(user:, policy_cache: CacheStore::NullStore.instance)
# record and user and finally throwing an error if the user is not
# authorized to perform the given action.
#
# @param user [Object] the user that initiated the action
# @param possibly_namespaced_record [Object, Array] the object we're checking permissions of
# @param query [Symbol, String] the predicate method to check on the policy (e.g. `:show?`)
# @param policy_class [Class] the policy class we want to force use of
Expand All @@ -40,7 +41,6 @@ def authorize(possibly_namespaced_record, query:, policy_class:)
# Retrieves the policy scope for the given record.
#
# @see https://github.com/varvet/pundit#scopes
# @param user [Object] the user that initiated the action
# @param scope [Object] the object we're retrieving the policy scope for
# @raise [InvalidConstructorError] if the policy constructor called incorrectly
# @return [Scope{#resolve}, nil] instance of scope class which can resolve to a scope
Expand All @@ -60,7 +60,6 @@ def policy_scope(scope)
# Retrieves the policy scope for the given record. Raises if not found.
#
# @see https://github.com/varvet/pundit#scopes
# @param user [Object] the user that initiated the action
# @param scope [Object] the object we're retrieving the policy scope for
# @raise [NotDefinedError] if the policy scope cannot be found
# @raise [InvalidConstructorError] if the policy constructor called incorrectly
Expand All @@ -81,7 +80,6 @@ def policy_scope!(scope)
# Retrieves the policy for the given record.
#
# @see https://github.com/varvet/pundit#policies
# @param user [Object] the user that initiated the action
# @param record [Object] the object we're retrieving the policy for
# @raise [InvalidConstructorError] if the policy constructor called incorrectly
# @return [Object, nil] instance of policy class with query methods
Expand All @@ -92,7 +90,6 @@ def policy(record)
# Retrieves the policy for the given record. Raises if not found.
#
# @see https://github.com/varvet/pundit#policies
# @param user [Object] the user that initiated the action
# @param record [Object] the object we're retrieving the policy for
# @raise [NotDefinedError] if the policy cannot be found
# @raise [InvalidConstructorError] if the policy constructor called incorrectly
Expand Down

0 comments on commit 993efc3

Please sign in to comment.