Changing permission wont affect the user

Obaid Khan7 years ago

I had Traccar server v3.15 and changed the database to mysql, when I used to change the permission for one of my user, it had no no affect on the user.
Now I upgraded my server to 3.16 and the problem is still there.
The user is just read only and changing the permission from admin account wont have any affect on it.
Help would be appreciated.

Obaid Khan7 years ago

Now the following error shows when I save any changes to any user account;

Unrecognized field "distanceUnit" (class org.traccar.model.User), not marked as ignorable (23 known properties: "readonly", "limitCommands", "deviceLimit", "poiLayer", "login", "name", "latitude", "phone", "admin", "userLimit", "zoom", "twelveHourFormat", "attributes", "deviceReadonly", "token", "id", "email", "longitude", "password", "map", "coordinateFormat", "disabled", "expirationTime"])
 at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@780245dc; line: 1, column: 465] (through reference chain: org.traccar.model.User["distanceUnit"])
Anton Tananaev7 years ago

Looks like you haven't upgraded web app.

Obaid Khan7 years ago

Thanks Anton. I will reinstall the traccar and check it.

Obaid Khan7 years ago

Anton, I just reinstalled the server. Unfortunately the problem is still there. It does not shows error now but when I add new user, It remain read only even if I change the permission.

Anton Tananaev7 years ago

It means that something is still not installed or configured correctly. Possibly you have some issue with database schema.

Hussah Saleh6 years ago

Dear Anton, I have same issue,
I just upgraded this amazing software to 4.3 and everything work fine. But, when I try to update user through API, I got the following response, However updating user through traccar web-app works perfect with no issues;

stdClass Object ( [responseCode] => 400 [error] => [response] => Unrecognized field "admin" (class org.traccar.model.User), not marked as ignorable (23 known properties: "readonly", "limitCommands", "deviceLimit", "poiLayer", "login", "name", "latitude", "administrator", "phone", "longitude", "userLimit", "zoom", "twelveHourFormat", "attributes", "deviceReadonly", "token", "id", "email", "coordinateFormat", "password", "map", "disabled", "expirationTime"]) at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 61] (through reference chain: org.traccar.model.User["admin"]) )

Hussah Saleh6 years ago

Oh, I have found the issue, was with my API curl file since once I upgraded the traccar version database changed.

function of updating user!

was

            `$data = '{"id":"' . $id . '","name":"' . $name . '","email":"' . $email . '","admin".........
            return self::curl('/api/users/' . $id, 'PUT', $cookie, $data, array(self::$jsonC));`

changed to:

            `$data = '{"id":"' . $id . '","name":"' . $name . '","email":"' . $email . '","administrator".........
            return self::curl('/api/users/' . $id, 'PUT', $cookie, $data, array(self::$jsonC));`

that solve my problem :)

Thanks Anton