parse-community / parse-php-sdk

The PHP SDK for Parse Platform
https://parseplatform.org/
Other
811 stars 346 forks source link

SignUp() function throws Fatal error #465

Open maxiqsoft opened 4 years ago

maxiqsoft commented 4 years ago

Hi, I have a problem creating new users. Even if I pass true within the signUp() call I get an error message. Now I created an user named Admin and a role named Admin but I really wanna know why the user creating with my settings doesnt work properly?

this is my source code:

require 'parse-php-sdk/autoload.php';
use Parse\ParseClient;
use Parse\ParseUser;

$master_key = "XXXXXXXXXXXX";
$app_id = "XXXXXXXXX";
ParseClient::initialize( $app_id, "", $master_key );
ParseClient::setServerURL('https://lalalala:443','parse');

$user = new ParseUser();
$user->set("username", $_POST['username']);
$user->set("password", $_POST['password']);

try 
{
    $user->signUp();
    echo ParseUser::getCurrentUser()->getSessionToken();

} 
catch (ParseException $ex) 
{
    echo "Error: " . $ex->getCode() . " " . $ex->getMessage();
}

Environment Details

This is the error message I get:

Fatal error: Uncaught Parse\ParseException: Permission denied for action create on class _User. in XXX\parse\parse-php-sdk\src\Parse\ParseClient.php:604 Stack trace: 
#0 XXX\parse\parse-php-sdk\src\Parse\ParseObject.php(1264): Parse\ParseClient::_request('POST', 'classes/_User', NULL, '{"username":"ha...', false) 
#1 XXX\parse\parse-php-sdk\src\Parse\ParseObject.php(1172): Parse\ParseObject::deepSave(Object(Parse\ParseUser), false) 
#2 XXX\parse\parse-php-sdk\src\Parse\ParseUser.php(122): Parse\ParseObject->save() 
#3 XXX\parse\create_user.php(20): Parse\ParseUser->signUp(true) 
#4 {main} thrown in XXX\parse\parse-php-sdk\src\Parse\ParseClient.php on line 604

These are the permissions for the class User

grafik