Jump to content

Recommended Posts

Posted

Hi,

I'm using the PHP client for call reports of a JasperServer community.

Whit the client I can create user, but when I call for put in a role with the examples of this website, i give and error that addRole not Exists!? and cannot add the Role to the creating user.

$newUser = new User(
    'BI_User',
    'superSTRENGTHpassw0rd',
    'clever@email.com',
    'Business Intelligence User',
    'organization_1',
    'true'
);
 
$role = new Role('ROLE_USER', null, 'false');
$newUser->addRole($role);
 
try {
   $c->userService()->addOrUpdateUser($newUser);
} catch (Exception $e) {
   printf('Could not add new user: %s', $e->getMessage());
}        
 
The line that fails: $newUser->addRole($role);
 
I have similar problems to add parameters, but with a  404 error of the server. I can't add parameters with the Client PHP Sample code. I don't know if the version of PHP Client is updated or where is the last version or if the version is the problem.
  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...