Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility for read only custom user attributes #5286

Open
victor-butler opened this issue Mar 15, 2024 · 1 comment
Open

Add possibility for read only custom user attributes #5286

victor-butler opened this issue Mar 15, 2024 · 1 comment

Comments

@victor-butler
Copy link

victor-butler commented Mar 15, 2024

Is your feature request related to a problem? Please describe.
It's a feature request: When adding custom user attributes, add a read only checkbox for the attribute:

image

If set to read only, only the admin can edit/remove the attribute.

This:

"attributes":
   {
      "distanceUnit": "mi",
      "speedUnit": "kmh"
   }

Would become this:

"attributes":
   {
      "distanceUnit": {
            "edit": 0,         //read only
            "value": "mi"
      },
      "speedUnit": {
            "edit": 1,         //can edit
            "value": "kmh"
      }
   }

Alternative 2 - same as above, we have a checkbox for Read Only but attributes can look like so:

"attributes":
   {
      "distanceUnit": "mi",
      "speedUnit": "kmh".
      "readOnly": {                                 //read only here
            "customAttribute1": "string",
            "customAttribute2": 5
      },
   }

Any thoughts?

@victor-butler
Copy link
Author

So finally this is what I came up with:

image

We don't touch the Attributes field but add a new one called Read Only Attributes, which works in the same was as the Attributes one, except that only an Admin can add and edit those attributes.

This solves the problem for compatibility for already existing APIs and only needs one additional column in the DB:
image

Same Read Only attributes can be also added for Devices, this will be a useful feature there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant