Skip to content

User Permissions not applied for dashboard chart data #919

@fahad-bren

Description

@fahad-bren

Describe the bug
User Permissions are not applied correctly in Insights. Restricted users can see data they should not have access to.

To Reproduce
Steps to reproduce the behavior:

  1. Set up User Permissions on a doctype so a user can only see a subset of records.
  2. Create an Insights query, chart, and a dashboard that uses that doctype.
  3. View the dashboard as the restricted user.
  4. The user sees all records instead of only those allowed by their User Permissions.

Expected behavior
Insights should respect site User Permissions and only show data the user is allowed to see.

Screenshots

Image

Current Problem

The restricted user sees all the records
Image

The restricted user can apply filter values that are not permitted
Image

Preferred Solution

The restricted user sees only the allowed records
Image

The restricted user can only apply valid filter values
Image

Desktop:

  • OS Ubuntu 22.04 LTS
  • Browser Chrome 145.0.7632.117
  • Version
  • frappe version-14 (14.99.3)
  • erpnext version-14 (14.92.2)
  • insights version-3 (3.3.1)

Additional context
User Permissions work correctly in insights develop (3.2.0-dev)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions