FOUR-10478: When creating scripts with AI, I find permissions issues preventing me from previewing them in the Preview Pane. by danloa · Pull Request #6204 · ProcessMaker/processmaker

Steps to reproduce:

  • Create a user with project permissions only.
  • Create a project and assign it to the previously created user.
  • Log in with the created user.
  • Create a process from scratch. The process must contain tasks and scripts.
  • Generate the process's assets using the AI Asset Generator.
    image
  • Try to use the preview feature in one of the script of the created process.

Current behavior:

A screen with an "Unauthorized" message is displayed

Expected behavior:

Process assets created for a process that pertains to a project must be accessible to users of the project, even if the users don't have the "view-scripts" and "view-screens" permissions.

Related issues:

https://processmaker.atlassian.net/browse/FOUR-14078
Related PR https://github.com/ProcessMaker/package-ai/pull/77

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.

CICD

ci:next