RSS feeds are now smart about password-protected webs

This commit is contained in:
Alexey Verkhovsky 2005-04-03 07:31:11 +00:00
parent bdb77c7108
commit 6f8b5b44d3
6 changed files with 61 additions and 10 deletions

View file

@ -28,10 +28,8 @@ class ApplicationController < ActionController::Base
end
def check_authorization
if in_a_web? and
not authorized? and
not %w( login authenticate published ).include?(@action_name)
redirect_to :action => 'login', :web => @web_name
if in_a_web? and needs_authorization?(@action_name) and not authorized? and
redirect_to :controller => 'wiki', :action => 'login', :web => @web_name
return false
end
end
@ -126,4 +124,8 @@ class ApplicationController < ActionController::Base
$instiki_wiki_service
end
def needs_authorization?(action)
not %w( login authenticate published rss_with_content rss_with_headlines ).include?(action)
end
end