Skip to content

FOUR-31145: Self Service tasks not visible to users in assigned subgroups - #9022

Open
rodriquelca wants to merge 1 commit into
developfrom
bugfix/FOUR-31145
Open

FOUR-31145: Self Service tasks not visible to users in assigned subgroups#9022
rodriquelca wants to merge 1 commit into
developfrom
bugfix/FOUR-31145

Conversation

@rodriquelca

@rodriquelca rodriquelca commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

A Self Service task assigned to group Main does not show for a user who is only in subgroup Sub (Sub ∈ Main). Inbox/claim compared the token’s self_service_groups to the user’s direct groups only.

The task list also broke: exclude() used $this->table (null) and generated SELECT .id, so the API returned 422 and the tab looked empty.

Repro: Homero in Sub → Sub in Main → process Self Service assigned to Main → login as Homero → Tasks → Self Service. List is empty; claim fails. To Do empty until claim is expected.

Solution

  • User::selfServiceGroupIds() = direct groups + ancestors (Group::ancestorIdsFor()). Used by availableSelfServiceTasksQuery() and canSelfServe(). Token is not rewritten.
  • Cache 10 min; GroupMemberObserver invalidates on membership changes.
  • scopeExclude() uses getTable() so the list SELECT is valid.
self.services.mov

How to Test

Run the unit test
./vendor/bin/phpunit tests/Feature/SelfServiceSubgroupTest.php

Related Tickets & Packages

https://processmaker.atlassian.net/browse/FOUR-31145

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@decisions-sonarqube

Copy link
Copy Markdown

@rodriquelca
rodriquelca requested a review from caleeli August 31, 2026 18:11
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.

1 participant