I have a problem since many days with Declarative_Authorization on Ruby on Rails 3.1. I add this on the top of each controller :
class UsersController < ApplicationController
# Verifies that the user is connected and/or authorized to access the methods
filter_access_to :all, :attribute_check => true
(...)
end
It allows me to have this on my authorization_rules.rb
:
has_permission_on [:albums], :to => [:adding] do
if_attribute :group => { :user => is { user } }
end
But when I add :attribute_check => true
I get this error :
Couldn't find {Model} without an ID
I'm totally lost, I was starting with this gem.
Your user variable is null maybe, so find the error why its null