Add master key override to live query ACL checks (#4133)

* Add master key override to live query ACL checks

* Fix mockClient so masterKey tests work correctly
This commit is contained in:
Jeremy May
2017-09-09 13:26:18 -04:00
committed by Florent Vilmart
parent 52c4dd3704
commit 121d151af9
3 changed files with 103 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ const dafaultFields = ['className', 'objectId', 'updatedAt', 'createdAt', 'ACL']
class Client {
id: number;
parseWebSocket: any;
hasMasterKey: boolean;
userId: string;
roles: Array<string>;
subscriptionInfos: Object;
@@ -20,9 +21,10 @@ class Client {
pushDelete: Function;
pushLeave: Function;
constructor(id: number, parseWebSocket: any) {
constructor(id: number, parseWebSocket: any, hasMasterKey: boolean) {
this.id = id;
this.parseWebSocket = parseWebSocket;
this.hasMasterKey = hasMasterKey;
this.roles = [];
this.subscriptionInfos = new Map();
this.pushConnect = this._pushEvent('connected');