On 24/03/10 14:58 -0400, Mohammed Morsi wrote:
Hi,
Just few notes:
>+ def new_user
>+ require_privilege(Privilege::POOL_MODIFY)
>+ require_privilege(Privilege::USER_MODIFY)
Why you can't just simply pass a Array as an argument to this method ?
Something like require_privileges([1, 2]).
>+
>+ @users = User.find(:all)
>+ @roles = Role.find(:all, :conditions => [ 'scope = ?', 'PortalPool' ])
>+ @pool = PortalPool.find(params[:id])
>+ end
>+
>+ def create_user
>+ require_privilege(Privilege::POOL_MODIFY)
>+ require_privilege(Privilege::USER_MODIFY)
In other hands, why not create a 'before_filter' for this ?
before_filter :require_privileges
>@@ -40,3 +40,4 @@
> <%= link_to "Hardware Profiles", {:action => "hardware_profiles", :id =>
> @pool.id}, :class=>"actionlink"%>
This could be: <%= link_to "Hardware Profiles", hardware_profiles_path(@pool),
:class => "actionlink"%>
(btw. @pool == hardware_profile ?)
- Michal
--
--------------------------------------------------------
Michal Fojtik, [email protected], +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel