cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prachi Damle <Prachi.Da...@citrix.com>
Subject RE: [DISCUSS] Major business logic refactoring: Move from Account to UserAccount
Date Thu, 20 Nov 2014 20:11:52 GMT
Rohit,

I checked the code here https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=shortlog;h=refs/heads/useraccount-refactoring
and I don't understand why we need to expose the userId parameter in the deployVm API. 
I think we should be using the userId of the logged in user always. 
Exposing the parameter at the API allows it to be set by a user to the ID of another user
. Also we need validation around it to make sure it belongs to the passed account etc.

+    //Owner userId
+    @Parameter(name = ApiConstants.USER_ID, type = CommandType.UUID, entityType = UserResponse.class,
required = true, description = "the user ID of the owner, optional to use with account and
domainId. If not provided logged in user's ID is used.")
+    private Long userId;


Prachi

-----Original Message-----
From: Rohit Yadav [mailto:rohit.yadav@shapeblue.com] 
Sent: Sunday, November 16, 2014 6:06 AM
To: dev@cloudstack.apache.org
Subject: Re: [DISCUSS] Major business logic refactoring: Move from Account to UserAccount

Only one table will be affected.

> On 16-Nov-2014, at 3:14 am, Amogh Vasekar <amogh.vasekar@citrix.com> wrote:
>
> Question - What happens to the already existing VMs with entries in 
> the DB? Do we keep it NULL?

NULL will be and not useful. I think it should be okay to have a db migration path that sets
user_id to the first user in account_id (which usually has the same name as account) for existing
VMs. The amount of code change will be minimal.

Checkout some code in this branch (has the db migration code and API layer changes); https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;a=shortlog;h=refs/heads/useraccount-refactoring

Regards,
Rohit Yadav
Software Architect, ShapeBlue
M. +91 88 262 30892 | rohit.yadav@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab

Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build<http://shapeblue.com/iaas-cloud-design-and-build//>
CSForge - rapid IaaS deployment framework<http://shapeblue.com/csforge/>
CloudStack Consulting<http://shapeblue.com/cloudstack-consultancy/>
CloudStack Software Engineering<http://shapeblue.com/cloudstack-software-engineering/>
CloudStack Infrastructure Support<http://shapeblue.com/cloudstack-infrastructure-support/>
CloudStack Bootcamp Training Courses<http://shapeblue.com/cloudstack-training/>

This email and any attachments to it may be confidential and are intended solely for the use
of the individual to whom it is addressed. Any views or opinions expressed are solely those
of the author and do not necessarily represent those of Shape Blue Ltd or related companies.
If you are not the intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender if you believe
you have received this email in error. Shape Blue Ltd is a company incorporated in England
& Wales. ShapeBlue Services India LLP is a company incorporated in India and is operated
under license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated
in Brasil and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company
registered by The Republic of South Africa and is traded under license from Shape Blue Ltd.
ShapeBlue is a registered trademark.

Mime
View raw message