Last active
August 29, 2015 14:03
-
-
Save niraj-shah/caa76f757b460826038d to your computer and use it in GitHub Desktop.
Parse.com PHP SDK - ACL Examples
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
<?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