Skip to content

[WEB-10174] fix: scope user activity and recents to access - #10320

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10174-scope-activity-recents
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10174-scope-activity-recents

Conversation

@pablohashescobar

@pablohashescobar pablohashescobar commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Description

Three reads returned live data without checking that the caller can still see it, so a user removed from a project kept reading current titles and descriptions:

  • GET /api/users/me/activities/ filtered only by actor, and its serializer embeds the live work item.
  • The user dashboard's overdue and upcoming lists had no visibility filter.
  • Recent visits resolved each entity by primary key alone.

Now:

  • The activity feed and the two dashboard lists use the existing _visible_issues_q filter.
  • Recent-visit entity data is resolved through get_favorite_entities, scoped to the row's workspace, with the restricted-guest rule for work items; anything no longer accessible returns null, which the web widget already drops.

Response shapes are unchanged.

Behavior change:

  • Recent visits in archived projects now return null entity data.
  • Activity rows with no work item drop out of the feed.

Not changed: the dashboard's counts and distributions are still unscoped (numbers only).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • New plane/tests/contract/app/test_user_activity_recents_scope_app.py: after the user's project membership is deactivated, the activity feed, the dashboard lists and recent visits no longer return that project's work item. 3 passed; all three fail without the fix.

References

  • WEB-10174

Created with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Activity feeds and workspace dashboards now show only issues the viewer is permitted to access.
    • Recent visits no longer reveal issue details after access is lost. Guests in restricted projects can see only issues they created.
    • Inaccessible issues are omitted from activity and dashboard lists.

…rrent access

The user activity feed, the user workspace dashboard issue lists and recent-visit entity data now follow the same visibility rule as the issue list, so they only carry data from projects the user is still an active member of.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@makeplane

makeplane Bot commented Nov 15, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Activity and dashboard issue queries now filter results by issue visibility. Recent-visit entity data is resolved within visitor, project, and workspace scope. Contract tests check these responses after project membership is deactivated.

Changes: Issue visibility

Layer / File(s) Summary
Enforce issue visibility across user surfaces
apps/api/plane/app/views/user/base.py, apps/api/plane/app/views/workspace/base.py, apps/api/plane/app/serializers/workspace.py, apps/api/plane/tests/contract/app/test_user_activity_recents_scope_app.py
Activity and dashboard issue queries now use the issue visibility filter. Recent-visit entity resolution scopes results to the visitor, project, and workspace, with an additional restriction for qualifying guest members. Contract tests check activity, dashboard, and recent-visit responses after project membership is deactivated.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: Minimal · up to 3fca2

This change limits activity, dashboard issue lists and recent visits to work items the user can still access. No actionable merge-blocking risk was identified. The main gap is that the tests cover only membership removal, not guest, entity-type or archived-project variants.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description follows the template. It has a Description section that explains the three affected reads and the fix. It marks the Type of Change boxes (Bug fix and Improvement). It gives test scenar…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the change: user activity and recent visits are now scoped to the user's access. The changeset also scopes the workspace dashboard overdue/upcoming lists to visible issues, which the t…
Full details: Description check

Explanation

The description follows the template. It has a Description section that explains the three affected reads and the fix. It marks the Type of Change boxes (Bug fix and Improvement). It gives test scenarios and a reference to WEB-10174. The Screenshots section holds only a placeholder comment, which is acceptable because the template marks it as applicable only when relevant.

Full details: Title check

Explanation

The title names the change: user activity and recent visits are now scoped to the user's access. The changeset also scopes the workspace dashboard overdue/upcoming lists to visible issues, which the title does not name, but the title still describes the main change. The title follows the repository's conventional-commit pattern with a ticket prefix.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4766dfab-7970-4dd0-b50f-7d4022b38390
Commits

Reviewing files that changed from the base of the PR and between 290383d and 3fca247.

Files selected for processing: 4

  • apps/api/plane/app/serializers/workspace.py
  • apps/api/plane/app/views/user/base.py
  • apps/api/plane/app/views/workspace/base.py
  • apps/api/plane/tests/contract/app/test_user_activity_recents_scope_app.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@pablohashescobar pablohashescobar changed the title [WEB-10174] fix(security): scope user activity and recents to access [WEB-10174] fix: scope user activity and recents to access Nov 16, 2026

@sriramveeraghanta sriramveeraghanta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Non-blocking: the activity feed now joins through project membership on every page. Probably fine, but worth watching for heavy users.

@sriramveeraghanta
sriramveeraghanta merged commit 4578ee3 into preview Nov 16, 2026
19 of 20 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10174-scope-activity-recents branch November 16, 2026 20:20
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
…#10320)

The user activity feed, the user workspace dashboard issue lists and recent-visit entity data now follow the same visibility rule as the issue list, so they only carry data from projects the user is still an active member of.

(cherry picked from commit 4578ee3)
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

Successfully merging this pull request may close these issues.

3 participants