1- function KuzzleSecurityDocument ( kuzzleSecurity , id , content ) {
1+ function KuzzleSecurityDocument ( Security , id , content ) {
22
33 if ( ! id ) {
44 throw new Error ( 'A security document must have an id' ) ;
@@ -8,10 +8,10 @@ function KuzzleSecurityDocument(kuzzleSecurity, id, content) {
88 Object . defineProperties ( this , {
99 // private properties
1010 kuzzle : {
11- value : kuzzleSecurity . kuzzle
11+ value : Security . kuzzle
1212 } ,
13- kuzzleSecurity : {
14- value : kuzzleSecurity
13+ Security : {
14+ value : Security
1515 } ,
1616 // read-only properties
1717 // writable properties
@@ -31,8 +31,8 @@ function KuzzleSecurityDocument(kuzzleSecurity, id, content) {
3131 }
3232
3333 // promisifying
34- if ( kuzzleSecurity . kuzzle . bluebird ) {
35- return kuzzleSecurity . kuzzle . bluebird . promisifyAll ( this , {
34+ if ( Security . kuzzle . bluebird ) {
35+ return Security . kuzzle . bluebird . promisifyAll ( this , {
3636 suffix : 'Promise' ,
3737 filter : function ( name , func , target , passes ) {
3838 var whitelist = [ 'delete' , 'update' ] ;
@@ -88,7 +88,7 @@ KuzzleSecurityDocument.prototype.delete = function (options, cb) {
8888 options = null ;
8989 }
9090
91- self . kuzzle . query ( this . kuzzleSecurity . buildQueryArgs ( this . deleteActionName ) , { _id : this . id } , options , function ( error , res ) {
91+ self . kuzzle . query ( this . Security . buildQueryArgs ( this . deleteActionName ) , { _id : this . id } , options , function ( error , res ) {
9292 if ( error ) {
9393 return cb ? cb ( error ) : false ;
9494 }
@@ -124,7 +124,7 @@ KuzzleSecurityDocument.prototype.update = function (content, options, cb) {
124124 data . _id = self . id ;
125125 data . body = content ;
126126
127- self . kuzzle . query ( this . kuzzleSecurity . buildQueryArgs ( this . updateActionName ) , data , options , function ( error , response ) {
127+ self . kuzzle . query ( this . Security . buildQueryArgs ( this . updateActionName ) , data , options , function ( error , response ) {
128128 if ( error ) {
129129 return cb ? cb ( error ) : false ;
130130 }
@@ -139,4 +139,4 @@ KuzzleSecurityDocument.prototype.update = function (content, options, cb) {
139139 return this ;
140140} ;
141141
142- module . exports = KuzzleSecurityDocument ;
142+ module . exports = KuzzleSecurityDocument ;
0 commit comments