Skip to content

Commit

Permalink
elabs => varvet
Browse files Browse the repository at this point in the history
  • Loading branch information
Linuus committed Jul 4, 2018
1 parent 8ed77c2 commit f6bf57b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://secure.travis-ci.org/varvet/pundit.svg?branch=master)](https://travis-ci.org/varvet/pundit)
[![Code Climate](https://codeclimate.com/github/varvet/pundit.svg)](https://codeclimate.com/github/varvet/pundit)
[![Inline docs](http://inch-ci.org/github/elabs/pundit.svg?branch=master)](http://inch-ci.org/github/elabs/pundit)
[![Inline docs](http://inch-ci.org/github/varvet/pundit.svg?branch=master)](http://inch-ci.org/github/varvet/pundit)
[![Gem Version](https://badge.fury.io/rb/pundit.svg)](http://badge.fury.io/rb/pundit)

Pundit provides a set of helpers which guide you in leveraging regular Ruby
Expand Down Expand Up @@ -778,7 +778,7 @@ Pundit does not provide a DSL for testing scopes. Just test it like a regular Ru
- [RailsApps Example Application: Pundit and Devise](https://github.com/RailsApps/rails-devise-pundit)
- [Migrating to Pundit from CanCan](http://blog.carbonfive.com/2013/10/21/migrating-to-pundit-from-cancan/)
- [Testing Pundit Policies with RSpec](http://thunderboltlabs.com/blog/2013/03/27/testing-pundit-policies-with-rspec/)
- [Using Pundit outside of a Rails controller](https://github.com/elabs/pundit/pull/136)
- [Using Pundit outside of a Rails controller](https://github.com/varvet/pundit/pull/136)
- [Straightforward Rails Authorization with Pundit](http://www.sitepoint.com/straightforward-rails-authorization-with-pundit/)

# License
Expand Down
24 changes: 12 additions & 12 deletions lib/pundit.rb
Expand Up @@ -74,7 +74,7 @@ def authorize(user, record, query, policy_class: nil)

# Retrieves the policy scope for the given record.
#
# @see https://github.com/elabs/pundit#scopes
# @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
Expand All @@ -88,7 +88,7 @@ def policy_scope(user, scope)

# Retrieves the policy scope for the given record.
#
# @see https://github.com/elabs/pundit#scopes
# @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
Expand All @@ -103,7 +103,7 @@ def policy_scope!(user, scope)

# Retrieves the policy for the given record.
#
# @see https://github.com/elabs/pundit#policies
# @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
Expand All @@ -117,7 +117,7 @@ def policy(user, record)

# Retrieves the policy for the given record.
#
# @see https://github.com/elabs/pundit#policies
# @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
Expand Down Expand Up @@ -171,7 +171,7 @@ def pundit_policy_scoped?
# `after_action` filter to prevent programmer error in forgetting to call
# {#authorize} or {#skip_authorization}.
#
# @see https://github.com/elabs/pundit#ensuring-policies-and-scopes-are-used
# @see https://github.com/varvet/pundit#ensuring-policies-and-scopes-are-used
# @raise [AuthorizationNotPerformedError] if authorization has not been performed
# @return [void]
def verify_authorized
Expand All @@ -182,7 +182,7 @@ def verify_authorized
# `after_action` filter to prevent programmer error in forgetting to call
# {#policy_scope} or {#skip_policy_scope} in index actions.
#
# @see https://github.com/elabs/pundit#ensuring-policies-and-scopes-are-used
# @see https://github.com/varvet/pundit#ensuring-policies-and-scopes-are-used
# @raise [AuthorizationNotPerformedError] if policy scoping has not been performed
# @return [void]
def verify_policy_scoped
Expand Down Expand Up @@ -213,23 +213,23 @@ def authorize(record, query = nil, policy_class: nil)

# Allow this action not to perform authorization.
#
# @see https://github.com/elabs/pundit#ensuring-policies-and-scopes-are-used
# @see https://github.com/varvet/pundit#ensuring-policies-and-scopes-are-used
# @return [void]
def skip_authorization
@_pundit_policy_authorized = true
end

# Allow this action not to perform policy scoping.
#
# @see https://github.com/elabs/pundit#ensuring-policies-and-scopes-are-used
# @see https://github.com/varvet/pundit#ensuring-policies-and-scopes-are-used
# @return [void]
def skip_policy_scope
@_pundit_policy_scoped = true
end

# Retrieves the policy scope for the given record.
#
# @see https://github.com/elabs/pundit#scopes
# @see https://github.com/varvet/pundit#scopes
# @param scope [Object] the object we're retrieving the policy scope for
# @param policy_scope_class [Class] the policy scope class we want to force use of
# @return [Scope{#resolve}, nil] instance of scope class which can resolve to a scope
Expand All @@ -240,7 +240,7 @@ def policy_scope(scope, policy_scope_class: nil)

# Retrieves the policy for the given record.
#
# @see https://github.com/elabs/pundit#policies
# @see https://github.com/varvet/pundit#policies
# @param record [Object] the object we're retrieving the policy for
# @return [Object, nil] instance of policy class with query methods
def policy(record)
Expand All @@ -253,7 +253,7 @@ def policy(record)
# what key the record should have in the params hash and retrieves the
# permitted attributes from the params hash under that key.
#
# @see https://github.com/elabs/pundit#strong-parameters
# @see https://github.com/varvet/pundit#strong-parameters
# @param record [Object] the object we're retrieving permitted attributes for
# @param action [Symbol, String] the name of the action being performed on the record (e.g. `:update`).
# If omitted then this defaults to the Rails controller action name.
Expand Down Expand Up @@ -297,7 +297,7 @@ def policy_scopes
# Hook method which allows customizing which user is passed to policies and
# scopes initialized by {#authorize}, {#policy} and {#policy_scope}.
#
# @see https://github.com/elabs/pundit#customize-pundit-user
# @see https://github.com/varvet/pundit#customize-pundit-user
# @return [Object] the user object to be used with pundit
def pundit_user
current_user
Expand Down
4 changes: 2 additions & 2 deletions lib/pundit/policy_finder.rb
Expand Up @@ -17,7 +17,7 @@ def initialize(object)
end

# @return [nil, Scope{#resolve}] scope class which can resolve to a scope
# @see https://github.com/elabs/pundit#scopes
# @see https://github.com/varvet/pundit#scopes
# @example
# scope = finder.scope #=> UserPolicy::Scope
# scope.resolve #=> <#ActiveRecord::Relation ...>
Expand All @@ -27,7 +27,7 @@ def scope
end

# @return [nil, Class] policy class with query methods
# @see https://github.com/elabs/pundit#policies
# @see https://github.com/varvet/pundit#policies
# @example
# policy = finder.policy #=> UserPolicy
# policy.show? #=> true
Expand Down
2 changes: 1 addition & 1 deletion pundit.gemspec
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
gem.email = ["jonas.nicklas@gmail.com", "dev@elabs.se"]
gem.description = "Object oriented authorization for Rails applications"
gem.summary = "OO authorization for Rails"
gem.homepage = "https://github.com/elabs/pundit"
gem.homepage = "https://github.com/varvet/pundit"
gem.license = "MIT"

gem.files = `git ls-files`.split($/)
Expand Down

0 comments on commit f6bf57b

Please sign in to comment.