[PATCH conductor 13/13] require Privilege::View on realm.provider when accessing realms

Mo Morsi mmorsi at redhat.com
Thu May 17 13:40:07 UTC 2012


---
 src/app/controllers/realms_controller.rb |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/app/controllers/realms_controller.rb b/src/app/controllers/realms_controller.rb
index 86f5b6a..859a3a3 100644
--- a/src/app/controllers/realms_controller.rb
+++ b/src/app/controllers/realms_controller.rb
@@ -109,6 +109,7 @@ class RealmsController < ApplicationController
 
   def show
     @realm = FrontendRealm.find(params[:id])
+    require_privilege(Privilege::VIEW, @realm.provider)
     @title = @realm.name
     @tab_captions = [t('realms.tab_captions.properties'), t('realms.tab_captions.mapping')]
     @details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
@@ -152,5 +153,6 @@ class RealmsController < ApplicationController
       {:name => t("realms.index.realm_name"), :sort_attr => :name},
     ]
     @realms = FrontendRealm.apply_filters(:preset_filter_id => params[:realms_preset_filter], :search_filter => params[:realms_search])
+    @realms.reject! { |realm| !check_privilege(Privilege::VIEW, realm.provider) }
   end
 end
-- 
1.7.6.5




More information about the aeolus-devel mailing list