[Ovirt-devel] [PATCH server] Revised attempt at refactoring the vm_controller using the service layer.

Scott Seago sseago at redhat.com
Thu Apr 23 22:42:03 UTC 2009


David Lutterkort wrote:
> On Thu, 2009-04-23 at 10:38 -0400, Scott Seago wrote:
>   
>>> How will this work from the Views? Right now the only place we access 
>>> @can_XXX is in the views, but generally views only have access to 
>>> controller instance variables, not methods..
>>> But certianly the can_XXX methods on pool could go away.
>>>       
>> Hmm. It also looks like we're using the pool.can_XXX methods in some 
>> places in the  views currently -- for example we only show what host a 
>> VM is running on if the hw_pool.can_view(@user) is true. So that 
>> combined with the issues in getting at the controller methods from the 
>> views would suggest that we leave this bit alone for the moment.
>>     
>
> All of this isn't that big a deal currently, I just dislike how
> knowledge of what is required to view something etc. is spread all over
> the place.
>
> But we're so far off on a tangent now that it's probably better to leave
> this for another day.
>
> David
>
>   
Yes, at this point I'd be inclined to clean up the @can_XXX/can_XXX bits 
in a separate commit later. It looks like we can probably consolidate 
the can_XXX bits -- but the authorized? service method vs. the 
authorize_XXX controller methods seem to retain a useful distinction 
(although perhaps a renaming would make this clear) -- they are related 
in much the smae way as XXXService.svc_create and XXXController.create 
are related.

Scott




More information about the ovirt-devel mailing list