link user_device

Developer6 years ago

is possible to link device to multi user, like this

tc_user_device

userid  |    deviceid
1          |   1
2          |   2
3          |   1
3          |   2

howto todo that if possible?

Anton Tananaev6 years ago

Yes, it's possible.

Developer6 years ago

I have to do it manually, but in webtraccar->devices list not visible...

Anton Tananaev6 years ago

Have you restarted service after adding it manually?

Developer6 years ago

Just restart service and problem solve, thank you, i hope next release this can automatic without restart service...

Anton Tananaev6 years ago

No, it won't. If you want automatic, you need to use API instead of modifying database directly.

Developer6 years ago

Yes, edit directly just for testing..

Gareth Curtis5 years ago

I'd like to do this too and found the same, didn't realise about restarting the server to reflect the changes though... : )

However, I have also tried to do this via the API but I think you can only map one device to one user this way?

I have disabled new user registration as I want to control who is registered and then would quite like admin to 'own' all the devices but then for each user to have their own device - like:

Admin - device1
Admin - device2
User1 - device1
User2 - device2

etc. I don't think that is possible is it? Please correct me if I'm wrong and there's a way to do this though...

I think the alternative would be to have the user1 add device1 to their account via the API, but then I have to switch on new user registration and allow anyone in and have lost the admin ability. Would admin still see the devices owned by User1 and 2?

Thoughts welcome please.

Thanks.

Gareth Curtis5 years ago

Boom! Permissions API - sorry. Didn't spot that.

This is such an excellent open source product!

Great work.