Tabnine Logo For Javascript
ACL
Code IndexAdd Tabnine to your IDE (free)

How to use
ACL
function
in
parse

Best JavaScript code snippets using parse.ACL(Showing top 15 results out of 315)

origin: parse-community/parse-server

beforeEach(async done => {
    const userACL = new Parse.ACL();
    userACL.setPublicReadAccess(true);
    await user.setACL(userACL).save(null, { useMasterKey: true });
    done();
   });
origin: parse-community/parse-server

it('can match ACL with none exist requestId', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue(undefined),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   });
 });
origin: parse-community/parse-server

it('test beforeDelete with locked down ACL', async () => {
  let called = false;
  Parse.Cloud.beforeDelete('GameScore', () => {
   called = true;
  });
  const object = new Parse.Object('GameScore');
  object.setACL(new Parse.ACL());
  await object.save();
  const objects = await new Parse.Query('GameScore').find();
  expect(objects.length).toBe(0);
  try {
   await object.destroy();
  } catch (e) {
   expect(e.code).toBe(Parse.Error.OBJECT_NOT_FOUND);
  }
  expect(called).toBe(false);
 });
origin: parse-community/parse-server

it("won't match non-public ACL with role when there is no user", function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setPublicReadAccess(false);
  acl.setRoleReadAccess('livequery', true);
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({}),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   })
   .catch(done.fail);
 });
origin: parse-community/parse-server

it('test beforeSave set object acl success', function(done) {
  const acl = new Parse.ACL({
   '*': { read: true, write: false },
  });
origin: parse-community/parse-server

it('can match ACL with valid client sessionToken', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setReadAccess(testUserId, true);
  // Mock sessionTokenCache will return false when sessionToken is undefined
  const client = {
   sessionToken: 'sessionToken',
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: undefined,
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(true);
    done();
   });
 });
origin: parse-community/parse-server

it("won't match ACL that doesn't have public read or any roles", function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setPublicReadAccess(false);
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: 'sessionToken',
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   });
 });
origin: parse-community/parse-server

beforeEach(async done => {
    const userACL = new Parse.ACL();
    userACL.setPublicReadAccess(true);
    await user.setACL(userACL).save(null, { useMasterKey: true });
    done();
   });
origin: parse-community/parse-server

it('will match non-public ACL when client has master key', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setPublicReadAccess(false);
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({}),
   hasMasterKey: true,
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(true);
    done();
   });
 });
origin: parse-community/parse-server

it('can match ACL with public read access', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setPublicReadAccess(true);
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: 'sessionToken',
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(true);
    done();
   });
 });
origin: parse-community/parse-server

it("won't match non-public ACL when client has no master key", function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setPublicReadAccess(false);
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({}),
   hasMasterKey: false,
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   });
 });
origin: parse-community/parse-server

it('can match ACL with subscription sessionToken checking error', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setReadAccess(testUserId, true);
  // Mock sessionTokenCache will return error when sessionToken is null, this is just
  // the behaviour of our mock sessionTokenCache, not real sessionTokenCache
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: null,
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   });
 });
origin: parse-community/parse-server

it('can match ACL with valid subscription sessionToken', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setReadAccess(testUserId, true);
  const client = {
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: 'sessionToken',
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(true);
    done();
   });
 });
origin: parse-community/parse-server

it('can match ACL with invalid subscription and client sessionToken', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setReadAccess(testUserId, true);
  // Mock sessionTokenCache will return false when sessionToken is undefined
  const client = {
   sessionToken: undefined,
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: undefined,
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   });
 });
origin: parse-community/parse-server

it('can match ACL with client sessionToken checking error', function (done) {
  const parseLiveQueryServer = new ParseLiveQueryServer({});
  const acl = new Parse.ACL();
  acl.setReadAccess(testUserId, true);
  // Mock sessionTokenCache will return error when sessionToken is null
  const client = {
   sessionToken: null,
   getSubscriptionInfo: jasmine
    .createSpy('getSubscriptionInfo')
    .and.returnValue({
     sessionToken: null,
    }),
  };
  const requestId = 0;

  parseLiveQueryServer
   ._matchesACL(acl, client, requestId)
   .then(function (isMatched) {
    expect(isMatched).toBe(false);
    done();
   });
 });
parse(npm)ACL

Most used parse functions

  • Cloud
  • Config
  • User
  • ACL.ACL
  • ACL.getPublicReadAccess
  • ACL.setPublicWriteAccess,
  • ACL.setReadAccess,
  • ACL.setRoleReadAccess,
  • ACL.setRoleWriteAccess,
  • ACL.setWriteAccess,
  • Analytics,
  • Error,
  • FacebookUtils,
  • File,
  • File.File,
  • File._name,
  • File._url,
  • File.addMetadata

Popular in JavaScript

  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • debug
    small debugging utility
  • minimist
    parse argument options
  • express
    Fast, unopinionated, minimalist web framework
  • crypto
  • minimatch
    a glob matcher in javascript
  • path
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • http
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now