Automatically assign a computed attribute

ubitec3 months ago

Hello everyone,

I have a question about automatic assignment of calculated attributes in Traccar. Similar to how configuration variables like Database.registerUnknown work, is there a way to automatically assign calculated attributes to devices, users, or groups?

I know that it is possible to manually link the calculated attributes at the user or group level, but I wonder if there is a higher level method (like at the server level so that everything in the system has them). o For example, if I assign a calculated attribute to an administrator, could all associated users or groups inherit it? Or could something be modified to achieve this?

If this is not currently possible, is there a way to implement it directly in Traccar code? If so, what files or classes should I focus on to make these modifications?

I would really appreciate any guidance on this. Thanks in advance!

Anton Tananaev3 months ago

You can link computed attributes to a group. And there's a configuration option to automatically put new devices into the group.

ubitec2 months ago

Thanks, but that only works for me from some levels and I have to repeat it every time, let's take an example, a basic attribute to change the color of the icon online=true?"info":"error", I want it for the entire server, but Every time I create a group (or a user if it does not have a group assigned) I have to link to that attribute, that is, do it manually each time to have it on the entire server and if it is created by another admin it is no longer global, any ideas How to set attributes or automatic or for the entire system? I know it would have to be modified, but if you could point me in the right direction it would be a great help.

Anton Tananaev2 months ago

Computed attributes will apply to a device regardless of user permissions, so I'm not sure how that's related.

ubitec2 months ago

I never referred to permissions, I know that the attribute is available for all admins or to use with it, I mean that every time a group is created you have to link to the created attribute, or link to the vehicle or user, the idea is a parameter, modification, or similar, so that the attribute is the default in everything created in the future, or is valid for the server

Anton Tananaev2 months ago

You asked about database.registerUnknown. That's what I answered about.

ubitec2 months ago

I don't think it's that difficult to understand "Similar to how configuration variables like Database.registerUnknown work" is a simple example