Don't know if this has been answered before.
Have custom routes to users. If I access the user directly /users/5 everything works. If I try /profile or even /users/current_user with Declarative Authorization I get "Couldn't find User without an ID"
map.profile "profile", :controller => "users", :action => "show"
map.edit_profile 'profile/edit', :controller => 'users', :action => 'edit', :conditions => { :method => :get }
My ApplicationController has
before_filter { |c| Authorization.current_user = c.current_user }
and my authorization_rules has user.id and also tried current_user.id.
role :user do
includes :guest
has_permission_on :users, :to => [:show, :edit ] do
if_attribute :id => is { user.id }
end
end
What am I doing wrong?