Exemplo n.º 1
0
 /**
  * Create new ParseACL with read and write access for the given user.
  *
  * @param ParseUser $user
  *
  * @return ParseACL
  */
 public static function createACLWithUser($user)
 {
     $acl = new ParseACL();
     $acl->setUserReadAccess($user, true);
     $acl->setUserWriteAccess($user, true);
     return $acl;
 }
Exemplo n.º 2
0
 /**
  * Get the defaultACL.
  *
  * @return ParseACL
  */
 public static function _getDefaultACL()
 {
     if (self::$defaultACLUsesCurrentUser && self::$defaultACL) {
         $last = self::$lastCurrentUser ? clone self::$lastCurrentUser : null;
         if (!ParseUser::getCurrentUser()) {
             return self::$defaultACL;
         }
         if ($last != ParseUser::getCurrentUser()) {
             self::$defaultACLWithCurrentUser = clone self::$defaultAC;
             self::$defaultACLWithCurrentUser->_setShared(true);
             self::$defaultACLWithCurrentUser->setUserReadAccess(ParseUser::getCurrentUser(), true);
             self::$defaultACLWithCurrentUser->setUserWriteAccess(ParseUser::getCurrentUser(), true);
             self::$lastCurrentUser = clone ParseUser::getCurrentUser();
         }
         return self::$defaultACLWithCurrentUser;
     }
     return self::$defaultACL;
 }