Created
August 2, 2013 17:50
-
-
Save niraj-shah/6141876 to your computer and use it in GitHub Desktop.
An example of setting ACL controls using Parse PHP SDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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