LocalAI
LocalAI copied to clipboard
Admin View as: follow-ups after the first version
The first version of the admin "View as" mode lets an administrator view another user's projects in the web UI, read-only by default, with a second step to allow changes. It builds on the ?user_id= impersonation that the project routes already accept (#13404). This issue tracks what the first version leaves out.
- [ ] The viewed user can see that an admin acted as them. Needs a backend activity record for impersonated writes, shown in the user's own activity. Today the server only writes a log line.
- [ ] Agents follow the mode. The agent routes do not read
user_idyet, so the Agents page keeps showing the admin's own data. - [ ] Knowledge follows the mode. Collection list and create use the caller; only the per-collection routes honour
user_id. - [ ] A disabled user ends the mode. The user lookup used for
user_idonly checks that the user exists, so a disabled user still passes. Only a deleted user ends the mode today. - [ ] Clearer end of the mode on a missing user. A 404 on a project route can mean a missing project, so the client ends the mode only on 403 or on the exact "user not found" message. A distinct error code would be cleaner.
- [ ] Chats follow the mode. Today chats show a notice that they are the admin's own.
- [ ] View another admin. Not allowed in the first version.
- [ ] A server-side read-only guarantee. Read-only is enforced in the browser only. The server accepts writes with
user_idfrom any admin client. A header or a scoped token that the server enforces would make it a real guarantee.