Skip to content

API: is_restricted_guest returns True for workspace admins holding a project GUEST role #10118

Open

Description

@shafiktanbir

While testing external API permissions on preview (commit 7805576), I noticed is_restricted_guest(user_id, project_id, slug) in apps/api/plane/api/views/issue.py (lines 199-217) returns True whenever the user has a ProjectMember row with role=ROLE.GUEST.value and project__guest_view_all_features=False, without checking whether the user is an active workspace admin (WorkspaceMember with role=ROLE.ADMIN.value).

In IntakeIssueDetailAPIEndpoint.delete (apps/api/plane/api/views/intake.py lines 494-511), even though lines 508-510 explicitly allow workspace admins (WorkspaceMember.objects.filter(..., role=20, is_active=True).exists()), line 494 calls is_restricted_guest first and raises IntakeIssue.DoesNotExist() (404) before reaching line 508 (and the other is_restricted_guest / guest_cannot_view_issue callers in intake.py, cycle.py, and module.py also block workspace admins who hold a project guest role). Should is_restricted_guest return False when the user is a workspace admin? Happy to open a quick PR if you want!

Activity

  1. ghazy2001 commented on Oct 28, 2026

    @ghazy2001
    Contributor

    Opened PR #10134 addressing this:

    • is_restricted_guest (apps/api/plane/api/views/issue.py): Now checks is_project_or_workspace_admin and WorkspaceMember.objects.filter(..., role=ROLE.ADMIN.value, is_active=True), returning False when the caller is an active workspace or project admin.
    • visible_issue_q (apps/api/plane/api/views/issue.py): Added an active workspace admin branch so workspace search queries return all project issues rather than restricting to created_by=user.
    • issue_hidden_from_guest (apps/api/plane/app/permissions/base.py): Added an active workspace admin check to return False, matching its documented intent ("Returns False for admins, members, unrestricted guests...").
    • Contract Tests: Added TestWorkspaceAdminWithProjectGuestRoleScope covering issue detail access, issue listing, intake issue deletion, and is_restricted_guest evaluation for workspace admins holding a project GUEST role.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions