Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/declarative_authorization/controller/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Runtime
# load the appropriate object from the current controller's model with
# the id from params[:id]. If that fails, a 404 Not Found is often the
# right way to handle the error. If you have additional measures in place
# that restricts the find scope, handling this error as a permission denied
# that restrict the find scope, handling this error as a permission denied
# might be a better way. Set failed_auto_loading_is_not_found to false
# for the latter behavior.
@@failed_auto_loading_is_not_found = true
Expand Down Expand Up @@ -59,7 +59,7 @@ def permitted_to?(privilege, object_or_sym = nil, options = {})
end
end

# Works similar to the permitted_to? method, but
# Works similarly to the permitted_to? method, but
# throws the authorization exceptions, just like Engine#permit!
def permitted_to!(privilege, object_or_sym = nil, options = {})
authorization_engine.permit!(privilege, options_for_permit(object_or_sym, options, true))
Expand Down
6 changes: 3 additions & 3 deletions lib/declarative_authorization/in_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def permitted_to?(privilege, options = {})
end
end

# Works similar to the permitted_to? method, but doesn't accept a block
# Works similarly to the permitted_to? method, but doesn't accept a block
# and throws the authorization exceptions, just like Engine#permit!
def permitted_to!(privilege, options = {})
options = {
Expand Down Expand Up @@ -107,15 +107,15 @@ def self.with_permissions_to(*args)
# using_access_control
# end
#
# If an operation is not permitted, a Authorization::AuthorizationError
# If an operation is not permitted, an Authorization::AuthorizationError
# is raised.
#
# To activate model security on all models, call using_access_control
# on ActiveRecord::Base
# ActiveRecord::Base.using_access_control
#
# Available options
# [:+context+] Specify context different from the models table name.
# [:+context+] Specify context different from the model's table name.
# [:+include_read+] Also check for :+read+ privilege after find.
#
def self.using_access_control(options = {})
Expand Down
8 changes: 4 additions & 4 deletions lib/declarative_authorization/maintenance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Authorization
# authorization.
module Maintenance
# Disables access control for the given block. Appropriate for
# maintenance operation at the Rails console or in test case setup.
# maintenance operations at the Rails console or in test case setup.
#
# For use in the Rails console:
# require "vendor/plugins/declarative_authorization/lib/maintenance"
Expand Down Expand Up @@ -141,7 +141,7 @@ def self.usages_by_controller
module TestHelper
include Authorization::Maintenance

# Analogue to the Ruby's assert_raise method, only executing the block
# Analogue to Ruby's assert_raise method, only executing the block
# in the context of the given user.
def assert_raise_with_user(user, *args)
assert_raise(*args) do
Expand All @@ -158,10 +158,10 @@ def assert_raise_with_user(user, *args)
# should_be_allowed_to :read, a_published_conference
# end
#
# If the objects class name does not match the controller name, you can set the object and context manually
# If the object's class name does not match the controller name, you can set the object and context manually
# should_be_allowed_to :create, :object => car, :context => :vehicles
#
# If you use specify the object and context manually, you can also specify the user manually, skipping the with_user block:
# If you specify the object and context manually, you can also specify the user manually, skipping the with_user block:
# should_be_allowed_to :create, :object => car, :context => :vehicles, :user => a_normal_user
def should_be_allowed_to(privilege, *args)
options = {}
Expand Down
Loading