Skip to content

Conversation

@eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Dec 10, 2025

Issue & Reproduction Steps

Creating a process from a default template assigns ownership to the template’s author/admin instead of the logged-in user. Reproduce by logging in as a non-admin user, calling POST /api/1.0/template/create/process/{id} with any default template id, and observing processes.user_id matches the template author rather than the requester.

Solution

  • Override the root asset’s user_id to the authenticated user during template-based process creation.
  • Persist the newly created process with user_id set to the authenticated user (no inheritance from the template author).
  • Add a regression test ensuring a process created from a template is owned by the logged-in user.

How to Test

  1. As a non-admin user, call POST /api/1.0/template/create/process/{id} using a default template id; confirm the new row in processes has user_id equal to the caller.
  2. Run the regression test: php artisan test --filter=ProcessTemplateTest::testProcessCreatedFromTemplateUsesAuthenticatedUserAsOwner

Related Tickets & Packages

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.

ci:deploy

@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-817a35c45c.engk8s.processmaker.net

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

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.

4 participants