[Ovirt-devel] [PATCH] move dialog fix.

Chris Lalancette clalance at redhat.com
Wed Oct 8 10:59:25 UTC 2008


Scott Seago wrote:
> fixes a problem in the move (and add pool to smart pool) dialogs when permission was granted to the top level DirectoryPool rather than to individual HW pools. This code will be going away soon anyway, as we need to migrate the dialog tree view away from the legacy implementation to jguiditta's new tree code.
> 
> This fixes BZ 464273 and 464398.
> 
> Signed-off-by: Scott Seago <sseago at redhat.com>
> ---
>  src/app/controllers/hardware_controller.rb |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/src/app/controllers/hardware_controller.rb b/src/app/controllers/hardware_controller.rb
> index 42ff9cb..9c04210 100644
> --- a/src/app/controllers/hardware_controller.rb
> +++ b/src/app/controllers/hardware_controller.rb
> @@ -76,6 +76,14 @@ class HardwareController < PoolController
>        open_list = []
>      else
>        pools = Pool.list_for_user(get_login_user,Permission::PRIV_VIEW)
> +      hw_root = HardwarePool.get_default_pool
> +      if !(pools.include?(hw_root))
> +        if pools.include?(DirectoryPool.get_directory_root)
> +          pools << hw_root
> +        elsif pools.include?(DirectoryPool.get_hardware_root)
> +          pools << hw_root
> +        end
> +      end

Minor nit, in that you could get rid of a redundant "pools << hw_root" line by
doing "if pools.include?(...get_directory_root) or
pool.include?(...get_hardware_root)", but it's very minor.  If this code is
going away soon anyway, then no big deal, and...

ACK

-- 
Chris Lalancette




More information about the ovirt-devel mailing list