Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created August 2, 2013 17:50
Show Gist options
  • Save niraj-shah/6141876 to your computer and use it in GitHub Desktop.
Save niraj-shah/6141876 to your computer and use it in GitHub Desktop.
An example of setting ACL controls using Parse PHP SDK
$parse = new parseObject('BlogPost');
$parse->title = "My first blog post";
$parse->story = "Welcome to my site. This is my first...";
$acl = new parseACL();
// Give the user Write access to object
$acl->setWriteAccessForId( $user_id, true );
// Give public read access
$acl->setPublicReadAccess( true );
// Disable write access for public
$acl->setPublicWriteAccess( false );
$parse->ACL = $acl->acl;
$result = $parse->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment