---
.../controllers/hardware_profiles_controller.rb | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/app/controllers/hardware_profiles_controller.rb
b/src/app/controllers/hardware_profiles_controller.rb
index aff1c2b..3c57bb1 100644
--- a/src/app/controllers/hardware_profiles_controller.rb
+++ b/src/app/controllers/hardware_profiles_controller.rb
@@ -17,7 +17,6 @@
class HardwareProfilesController < ApplicationController
before_filter :require_user
before_filter :load_hardware_profiles, :only => [:index, :show]
- before_filter :load_hardware_profile, :only => [:show]
before_filter :setup_new_hardware_profile, :only => [:new]
before_filter :setup_hardware_profile, :only => [:new, :create,
:matching_provider_hardware_profiles, :edit, :update]
@@ -217,6 +216,7 @@ class HardwareProfilesController < ApplicationController
begin
@matching_hwps = HardwareProfile.matching_hardware_profiles(@hardware_profile)
+ @matching_hwps.reject! { |hwp| !check_privilege(Privilege::View, hwp) }
rescue Exception => e
@matching_hwps = []
end
@@ -244,10 +244,8 @@ class HardwareProfilesController < ApplicationController
@hardware_profiles.sort! {|x,y| y.get_property_map[sort_field].sort_value(false)
<=> x.get_property_map[sort_field].sort_value(false)}
end
end
- end
- def load_hardware_profile
- @hardware_profile = HardwareProfile.find(params[:id])
+ @hardware_profiles.reject! { |hwp| !check_privilege(Privilege::View, hwp) }
end
def build_hardware_profile(params)
--
1.7.6.5