Skip to content

FOLLOW-UP: Cache user role per WebSocket connection (from PR #273) #274

@adnaan

Description

@adnaan

Context

This follow-up task was identified during the review of PR #273.

Source PR: #273
PR Title: feat: add authorization / RBAC system (Roadmap 2.3)
Suggested by: @claude[bot]

Task Description

The generated handler calls getUserRole() (which does GetUserByID()) on every Edit, Update, RequestDelete, and ConfirmDelete action. Since LiveTemplate uses long-lived WebSocket connections and roles change infrequently, the role should be cached per connection lifetime.

Options:

  • Cache the role in the controller state after first load
  • Store role in LiveTemplate session context during Mount
  • Use ctx.UserID() + in-memory LRU cache with short TTL

This issue was automatically created by prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions