Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niraj-shah/caa76f757b460826038d to your computer and use it in GitHub Desktop.
Save niraj-shah/caa76f757b460826038d to your computer and use it in GitHub Desktop.
Parse.com PHP SDK - ACL Examples
<?php
// true = access allowed, false = not allowed
// create ACL
$acl = new parseACL();
// public can read
$acl->setPublicReadAccess( true );
// public cannot write
$acl->setPublicWriteAccess( false );
// user can read data
$acl->setReadAccessForId( $user_id, true );
// user can write data
$acl->setWriteAccessForId( $user_id, true );
// save ACL to object
$parse->ACL = $acl->acl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment