@@ -161,18 +161,18 @@ export default class ParseFile {
161
161
* @param {Object } options A Backbone-style options object.
162
162
* @return {Parse.Promise } Promise that is resolved when the save finishes.
163
163
*/
164
- save ( options ?: { success ?: any , error ?: any } ) {
164
+ save ( options ?: { useMasterKey ?: boolean , success ?: any , error ?: any } ) {
165
165
options = options || { } ;
166
166
var controller = CoreManager . getFileController ( ) ;
167
167
if ( ! this . _previousSave ) {
168
168
if ( this . _source . format === 'file' ) {
169
- this . _previousSave = controller . saveFile ( this . _name , this . _source ) . then ( ( res ) => {
169
+ this . _previousSave = controller . saveFile ( this . _name , this . _source , options ) . then ( ( res ) => {
170
170
this . _name = res . name ;
171
171
this . _url = res . url ;
172
172
return this ;
173
173
} ) ;
174
174
} else {
175
- this . _previousSave = controller . saveBase64 ( this . _name , this . _source ) . then ( ( res ) => {
175
+ this . _previousSave = controller . saveBase64 ( this . _name , this . _source , options ) . then ( ( res ) => {
176
176
this . _name = res . name ;
177
177
this . _url = res . url ;
178
178
return this ;
@@ -256,7 +256,7 @@ var DefaultController = {
256
256
return CoreManager . getRESTController ( ) . ajax ( 'POST' , url , source . file , headers ) ;
257
257
} ,
258
258
259
- saveBase64 : function ( name : string , source : FileSource ) {
259
+ saveBase64 : function ( name : string , source : FileSource , options ?: { useMasterKey ?: boolean , success ?: any , error ?: any } ) {
260
260
if ( source . format !== 'base64' ) {
261
261
throw new Error ( 'saveBase64 can only be used with Base64-type sources.' ) ;
262
262
}
@@ -267,7 +267,7 @@ var DefaultController = {
267
267
data . _ContentType = source . type ;
268
268
}
269
269
var path = 'files/' + name ;
270
- return CoreManager . getRESTController ( ) . request ( 'POST' , path , data ) ;
270
+ return CoreManager . getRESTController ( ) . request ( 'POST' , path , data , options ) ;
271
271
}
272
272
} ;
273
273
0 commit comments