Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor spelling fixes

  • Loading branch information...
commit 924ae3fe41009f85db65d8e7b21b7b613b1945f7 1 parent 67ec014
@dnagir authored
Showing with 10 additions and 5 deletions.
  1. +6 −2 lib/allowy/access_control.rb
  2. +4 −3 lib/allowy/context.rb
View
8 lib/allowy/access_control.rb
@@ -1,6 +1,6 @@
module Allowy
# This module provides the interface for implementing the access control actions.
- # In order to use it, mix it into a poor Ruby class and define methods ending with `?`.
+ # In order to use it, mix it into a plain Ruby class and define methods ending with `?`.
# For example:
#
# @example
@@ -10,6 +10,7 @@ module Allowy
# def view?(page)
# page and page.wiki? and context.user_signed_in?
# end
+ # end
#
# And then you can check the permissions from a controller:
#
@@ -20,17 +21,20 @@ module Allowy
# end
#
#
- # You can also check the permissions outside of the controller, but you need a similar `Allowy::Context` class:
+ # You can also check the permissions outside of the controller, but you need an object that
+ # includes `Allowy::Context` class:
#
# @example
# class CucumberContext
# include Allowy::Context
# attr_accessor :current_user
+ #
# def initialize(user)
# @current_user = user
# end
# end
#
+ # CucumberContext.new(that_user).can?(:create, Blog)
# CucumberContext.new(that_user).should be_able_to :create, Blog
#
module AccessControl
View
7 lib/allowy/context.rb
@@ -2,11 +2,11 @@ module Allowy
# This module provides the default and common context for checking the permissions.
# It is mixed into controllers in Rails by default and provides an easy way to reuse it
- # in other parts of the application (in RSpec or Cucumber) without needing a controller.
+ # in other parts of the application (RSpec, Cucumber or standalone).
# For example, you can use this code in your Cucumber features:
#
# @example
- # class CustomContext
+ # class CucumberContext
# include Allowy::Context
# attr_accessor :current_user
#
@@ -17,7 +17,8 @@ module Allowy
# And then you can easily check the permissions like so:
#
# @example
- # CustomContext.new(that_user).should be_able_to :create, Blog
+ # CucumberContext.new(that_user).can?(:create, Blog)
+ # CucumberContext.new(that_user).should be_able_to :create, Blog
module Context
extend ActiveSupport::Concern
Please sign in to comment.
Something went wrong with that request. Please try again.