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

How to use
setReadAccess
function
in
ACL

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

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('acl sharing with another user and update', async done => {
  // Sign in as Bob.
  const bob = await Parse.User.signUp('bob', 'pass');
  await Parse.User.logOut();
  // Sign in as Alice.
  const alice = await Parse.User.signUp('alice', 'wonderland');
  // Create an object shared by Bob and Alice.
  const object = new TestObject();
  const acl = new Parse.ACL(alice);
  acl.setWriteAccess(bob, true);
  acl.setReadAccess(bob, true);
  object.setACL(acl);
  await object.save();
  equal(object.getACL().getReadAccess(alice), true);
  equal(object.getACL().getWriteAccess(alice), true);
  equal(object.getACL().getReadAccess(bob), true);
  equal(object.getACL().getWriteAccess(bob), true);
  equal(object.getACL().getPublicReadAccess(), false);
  equal(object.getACL().getPublicWriteAccess(), false);

  // Sign in as Bob again.
  await Parse.User.logIn('bob', 'pass');
  object.set('foo', 'bar');
  object.save().then(done);
 });
origin: parse-community/parse-server

ACL.setReadAccess(user, true);
ACL.setWriteAccess(user, true);
obj.setACL(ACL);
origin: parse-community/parse-server

const acl = new Parse.ACL(alice);
acl.setWriteAccess(bob, true);
acl.setReadAccess(bob, true);
object.setACL(acl);
await object.save();
origin: parse-community/parse-server

const acl = new Parse.ACL(alice);
acl.setWriteAccess(bob, true);
acl.setReadAccess(bob, true);
object.setACL(acl);
await object.save();
origin: parse-community/parse-server

ACL.setReadAccess(user, true);
ACL.setWriteAccess(user, true);
obj.setACL(ACL);
origin: parse-community/parse-server

const acl = new Parse.ACL(alice);
acl.setWriteAccess(bob, true);
acl.setReadAccess(bob, true);
object.setACL(acl);
await object.save();
origin: parse-community/parse-server

it('acl sharing with another user and public find', async done => {
  const bob = await Parse.User.signUp('bob', 'pass');
  await Parse.User.logOut();
  // Sign in as Alice.
  const alice = await Parse.User.signUp('alice', 'wonderland');
  // Create an object shared by Bob and Alice.
  const object = new TestObject();
  const acl = new Parse.ACL(alice);
  acl.setWriteAccess(bob, true);
  acl.setReadAccess(bob, true);
  object.setACL(acl);
  await object.save();
  equal(object.getACL().getReadAccess(alice), true);
  equal(object.getACL().getWriteAccess(alice), true);
  equal(object.getACL().getReadAccess(bob), true);
  equal(object.getACL().getWriteAccess(bob), true);
  equal(object.getACL().getPublicReadAccess(), false);
  equal(object.getACL().getPublicWriteAccess(), false);

  // Start making requests by the public.
  Parse.User.logOut().then(() => {
   const query = new Parse.Query(TestObject);
   query.find().then(function(results) {
    equal(results.length, 0);
    done();
   });
  });
 });
origin: parse-community/parse-server

it('acl sharing with another user and get', async done => {
  // Sign in as Bob.
  const bob = await Parse.User.signUp('bob', 'pass');
  await Parse.User.logOut();

  const alice = await Parse.User.signUp('alice', 'wonderland');
  // Create an object shared by Bob and Alice.
  const object = new TestObject();
  const acl = new Parse.ACL(alice);
  acl.setWriteAccess(bob, true);
  acl.setReadAccess(bob, true);
  object.setACL(acl);
  await object.save();
  equal(object.getACL().getReadAccess(alice), true);
  equal(object.getACL().getWriteAccess(alice), true);
  equal(object.getACL().getReadAccess(bob), true);
  equal(object.getACL().getWriteAccess(bob), true);
  equal(object.getACL().getPublicReadAccess(), false);
  equal(object.getACL().getPublicWriteAccess(), false);

  // Sign in as Bob again.
  await Parse.User.logIn('bob', 'pass');
  const query = new Parse.Query(TestObject);
  query.get(object.id).then(result => {
   ok(result);
   equal(result.id, object.id);
   done();
  });
 });
origin: parse-community/parse-server

const acl = new Parse.ACL(alice);
acl.setWriteAccess(bob, true);
acl.setReadAccess(bob, true);
object.setACL(acl);
await object.save();
origin: parse-community/parse-server

it('acl sharing with another user and delete', async done => {
  // Sign in as Bob.
  const bob = await Parse.User.signUp('bob', 'pass');
  await Parse.User.logOut();
  // Sign in as Alice.
  const alice = await Parse.User.signUp('alice', 'wonderland');
  // Create an object shared by Bob and Alice.
  const object = new TestObject();
  const acl = new Parse.ACL(alice);
  acl.setWriteAccess(bob, true);
  acl.setReadAccess(bob, true);
  object.setACL(acl);
  await object.save();
  equal(object.getACL().getReadAccess(alice), true);
  equal(object.getACL().getWriteAccess(alice), true);
  equal(object.getACL().getReadAccess(bob), true);
  equal(object.getACL().getWriteAccess(bob), true);
  equal(object.getACL().getPublicReadAccess(), false);
  equal(object.getACL().getPublicWriteAccess(), false);

  // Sign in as Bob again.
  await Parse.User.logIn('bob', 'pass');
  object.set('foo', 'bar');
  object.destroy().then(done);
 });
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('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)ACLsetReadAccess

Most used parse functions

  • Cloud
  • Config
  • User
  • ACL
  • ACL.ACL
  • ACL.setPublicReadAccess,
  • 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)
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • request
    Simplified HTTP request client.
  • minimatch
    a glob matcher in javascript
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • mime-types
    The ultimate javascript content-type utility.
  • http
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • Top plugins for Android Studio
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