Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/heimdallr/proxy/record.rb
  2. +1 −1  spec/proxy_examples.rb
4 lib/heimdallr/proxy/record.rb
View
@@ -289,7 +289,7 @@ def inspect
#
# @return [Hash]
def reflect_on_security
- operations = @restrictions.actions | ( destroyable? ? [:delete] : [] )
+ operations = @restrictions.actions | ( destroyable? ? [:destroy] : [] )
{
model: @record.class,
context: @context,
@@ -321,7 +321,7 @@ def destroyable?
end
# Checks, if restrictions allow to do an +action+.
- # Standard actions like +:create+, +:update+, +:delete+
+ # Standard actions like +:create+, +:update+, +:destroy+
# and +:fetch+ can be extanded with custom ones.
#
# @return [Boolean]
2  spec/proxy_examples.rb
View
@@ -114,7 +114,7 @@ def run_specs(user_model, article_model, dont_save_model, comments_model)
describe "contains all available actions in reflect_on_security[:operations]" do
it "of Proxy::Record" do
article = article_model.create! :owner_id => @john.id, :content => 'test', :secrecy_level => 4
- article.restrict(@john).reflect_on_security[:operations].should =~ [:create, :view, :update, :delete, :foo]
+ article.restrict(@john).reflect_on_security[:operations].should =~ [:create, :view, :update, :destroy, :foo]
article.restrict(@looser).reflect_on_security[:operations].should =~ [:create, :view]
end

No commit comments for this range

Something went wrong with that request. Please try again.