Skip to content

Commit e282cc3

Browse files
committed
Merge branch 'develop' into nolanpro-patch-1
2 parents 1b8aed9 + 1d2cc90 commit e282cc3

10 files changed

Lines changed: 221 additions & 106 deletions

File tree

ProcessMaker/Http/Controllers/Api/V1_1/CaseController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ public function __construct(private Request $request, CaseApiRepository $caseRep
4343
*/
4444
public function getAllCases(CaseListRequest $request): JsonResponse
4545
{
46+
// Users are always allowed to view cases scoped to themselves
47+
// Any broader query requires the `view-all_cases` permission.
48+
// Admins pass through via Gate::before in AuthServiceProvider.
49+
$authUser = Auth::user();
50+
$requestedUserId = $request->filled('userId') ? (int) $request->input('userId') : null;
51+
$isViewingOwnCases = $requestedUserId !== null && $requestedUserId === $authUser->id;
52+
53+
if (!$isViewingOwnCases && !$authUser->can('view-all_cases')) {
54+
abort(403);
55+
}
56+
4657
$query = $this->caseRepository->getAllCases($request);
4758

4859
return $this->paginateResponse($query);

ProcessMaker/Http/Controllers/CasesController.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,21 @@ class CasesController extends Controller
2222
/**
2323
* Get the list of requests.
2424
*
25+
* @param string|null $type One of `all|in_progress|completed` (constrained by the route).
26+
*
2527
* @return \Illuminate\View\View|\Illuminate\Contracts\View
2628
*/
27-
public function index()
29+
public function index($type = null)
2830
{
31+
// The "All cases" tab exposes every case in the platform regardless
32+
// of the user's relationship to it, so it is gated by the
33+
// `view-all_cases` permission. The other tabs (My cases, In progress,
34+
// Completed) are scoped to the user and need no gate.
35+
// Admins bypass this check via Gate::before in AuthServiceProvider.
36+
if ($type === 'all' && !Auth::user()->can('view-all_cases')) {
37+
abort(403);
38+
}
39+
2940
$manager = app(ScreenBuilderManager::class);
3041
event(new ScreenBuilderStarting($manager, 'FORM'));
3142
$currentUser = Auth::user()->only(['id', 'username', 'fullname', 'firstname', 'lastname', 'avatar']);

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "processmaker/processmaker",
3-
"version": "2026.8.2",
3+
"version": "2026.9.1",
44
"description": "BPM PHP Software",
55
"keywords": [
66
"php bpm processmaker"
@@ -113,7 +113,7 @@
113113
"Gmail"
114114
],
115115
"processmaker": {
116-
"build": "90d83217",
116+
"build": "5c91234c",
117117
"cicd-enabled": true,
118118
"custom": {
119119
"package-ellucian-ethos": "1.19.10",
@@ -155,9 +155,9 @@
155155
"connector-slack": "1.9.6",
156156
"docker-executor-node-ssr": "1.7.4",
157157
"package-ab-testing": "1.4.2",
158-
"package-actions-by-email": "1.22.13",
158+
"package-actions-by-email": "1.22.14",
159159
"package-advanced-user-manager": "1.13.3",
160-
"package-ai": "1.16.17",
160+
"package-ai": "1.16.18",
161161
"package-analytics-reporting": "1.11.5",
162162
"package-auth": "1.24.15",
163163
"package-collections": "2.27.6",
@@ -166,7 +166,7 @@
166166
"package-data-sources": "1.34.10",
167167
"package-decision-engine": "1.16.3",
168168
"package-dynamic-ui": "1.28.4",
169-
"package-email-start-event": "1.0.11",
169+
"package-email-start-event": "1.0.12",
170170
"package-files": "1.23.6",
171171
"package-googleplaces": "1.12.1",
172172
"package-photo-video": "1.6.3",
@@ -176,7 +176,7 @@
176176
"package-product-analytics": "1.5.11",
177177
"package-projects": "1.12.9",
178178
"package-rpa": "1.1.2",
179-
"package-savedsearch": "1.43.12",
179+
"package-savedsearch": "1.43.13",
180180
"package-slideshow": "1.4.3",
181181
"package-smart-extract": "0.0.6",
182182
"package-signature": "1.15.5",
@@ -250,4 +250,4 @@
250250
"ignore": []
251251
}
252252
}
253-
}
253+
}

database/migrations/2026_05_19_102552_update_passport_schema.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

database/seeders/UserSeeder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public function run(ClientRepository $clients)
5555
]);
5656

5757
// Create client so we can generate tokens
58-
$personalAccessClient = $clients->createPersonalAccessGrantClient('PmApi');
59-
$personalAccessClient->save();
58+
$clients->createPersonalAccessGrantClient('PmApi');
6059

6160
// Create client OAuth (for 3-legged auth) - Authorization Code Grant for Swagger UI
6261
$clients->createAuthorizationCodeGrantClient(

package-lock.json

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@processmaker/processmaker",
3-
"version": "2026.8.2",
3+
"version": "2026.9.1",
44
"description": "ProcessMaker 4",
55
"author": "DevOps <devops@processmaker.com>",
66
"license": "ISC",
@@ -61,9 +61,9 @@
6161
"@fortawesome/free-solid-svg-icons": "^5.15.1",
6262
"@fortawesome/vue-fontawesome": "^0.1.9",
6363
"@panter/vue-i18next": "^0.15.2",
64-
"@processmaker/modeler": "1.69.40",
64+
"@processmaker/modeler": "1.69.41",
6565
"@processmaker/processmaker-bpmn-moddle": "0.16.1",
66-
"@processmaker/screen-builder": "3.8.34",
66+
"@processmaker/screen-builder": "3.8.35",
6767
"@processmaker/vue-form-elements": "0.65.8",
6868
"@processmaker/vue-multiselect": "2.3.2",
6969
"@tinymce/tinymce-vue": "2.0.0",

tests/Feature/Api/V1_1/CaseControllerSearchTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Tests\Feature\Api\V1_1;
44

5+
use Illuminate\Support\Facades\Gate;
6+
use ProcessMaker\Models\Permission;
57
use ProcessMaker\Models\User;
68
use ProcessMaker\Repositories\CaseUtils;
79
use Tests\Feature\Shared\RequestHelper;
@@ -16,6 +18,17 @@ public function setUp(): void
1618
parent::setUp();
1719

1820
$this->user = CaseControllerTest::createUser('user_a');
21+
22+
// These tests intentionally exercise the unscoped `get_all_cases`
23+
// endpoint, which now requires `view-all_cases`. Grant the
24+
// non-admin test user the permission so each `apiCall` reaches
25+
// the search logic rather than being short-circuited with a 403.
26+
Permission::firstOrCreate(
27+
['name' => 'view-all_cases'],
28+
['title' => 'View All Cases'],
29+
);
30+
Gate::define('view-all_cases', fn ($user) => $user->hasPermission('view-all_cases'));
31+
$this->user->giveDirectPermission('view-all_cases');
1932
}
2033

2134
public function tearDown(): void

0 commit comments

Comments
 (0)