Fixed: non member or anonymous permissions change is effective only after an application restart (#1280).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1443 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-05-22 18:08:54 +00:00
parent 62125cad33
commit 82c12d09e9
1 changed files with 1 additions and 2 deletions

View File

@ -258,13 +258,12 @@ class User < ActiveRecord::Base
end end
def self.anonymous def self.anonymous
return @anonymous_user if @anonymous_user
anonymous_user = AnonymousUser.find(:first) anonymous_user = AnonymousUser.find(:first)
if anonymous_user.nil? if anonymous_user.nil?
anonymous_user = AnonymousUser.create(:lastname => 'Anonymous', :firstname => '', :mail => '', :login => '', :status => 0) anonymous_user = AnonymousUser.create(:lastname => 'Anonymous', :firstname => '', :mail => '', :login => '', :status => 0)
raise 'Unable to create the anonymous user.' if anonymous_user.new_record? raise 'Unable to create the anonymous user.' if anonymous_user.new_record?
end end
@anonymous_user = anonymous_user anonymous_user
end end
private private