Skip to content

[BUG]: Zod validation error in case of missing permissions #2363

Description

@novasam23

If a user does not have permissions to READ users, opening the agent edit page (amongst others) will result in a Zod validation error, see attached screenshot. The reason seems to be, that without the READ permission, the users API endpoint only returns a stripped down version of the user model, i.e. only comprised of the name field in this case.

Users API response without vs. with READ permissions on users.

     "attributes": {
          "name": "admin"
      },
      "attributes": {
          "name": "admin",
          "email": "admin@localhost",
          "isValid": true,
          "isComputedPassword": true,
          "lastLoginDate": 1784900676,
          "registeredSince": 1781073551,
          "sessionLifetime": 3600,
          "globalPermissionGroupId": 1,
          "yubikey": "0",
          "otp1": "",
          "otp2": "",
          "otp3": "",
          "otp4": ""
      },

That's however the expected behaviour, because without the necessary permissions, only "public" fields of an entity get returned. The potential fix then is probably with the Zod validation in the frontend.

This error notification ostensibly only shows in a non-production environment, so I think this is a minor bug.

Image

Metadata

Metadata

Labels

bugSomething isn't workinguiHashtopolis UI related

Type

No type

Projects

Status
To triage
Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions