[AC-3178] ACS Object update by another
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-01-01T22:06:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ACS, Cloud |
Reporter | Imraan Jhetam |
Assignee | Ritu Agrawal |
Created | 2012-04-19T08:18:43.000+0000 |
Updated | 2016-03-08T07:57:34.000+0000 |
Description
The documents state that "Only the owner of the object can update the object."
How can someone else update an object created by another?
For example i have created an object like so:
Cloud.Objects.create({ classname: 'cars', fields: { make: 'nissan', color: 'blue', year: 2005 } }, function (e) { if (e.success) { var car = e.cars[0]; alert('Success:\\n' + 'id: ' + car.id + '\\n' + 'make: ' + car.make + '\\n' + 'color: ' + car.color + '\\n' + 'year: ' + car.year + '\\n' + 'created_at: ' + car.created_at); } else { alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e))); } });
We then want another user who is logged into my app to update it like so:
Cloud.Objects.update({ classname: 'cars', id: savedCar1.id, fields: { color: 'purple', mileage: 10000 } }, function (e) { if (e.success) { var car = e.cars[0]; alert('Success:\\n' + 'id: ' + car.id + '\\n' + 'make: ' + car.make + '\\n' + 'color: ' + car.color + '\\n' + 'year: ' + car.year + '\\n' + 'mileage: ' + car.mileage + '\\n' + 'updated_at: ' + car.updated_at); } else { alert('Error:\\n' + ((e.error && e.message) || JSON.stringify(e))); } });
Can this be looked at please
Hello, the behavior you described is expected: currently it is not possible to edit objects created by others, while it is allowed to see them. We are working on a ACL feature that will allow to configure read/write properties for the objects; this will be released in the near future. Thanks for contacting us.
ACS now supports ACL functionality that should enable you to implement your use case. Please let us know if you have any follow up question.
http://docs.appcelerator.com/cloud/latest/#!/api/ACLs