Skip to content

Conversation

@sanjacornelius
Copy link
Contributor

@sanjacornelius sanjacornelius commented Mar 21, 2023

Issue & Reproduction Steps

Ticket: FOUR-7566

As part of Process Templates EPIC FOUR-7375, a Master Builder should be able to define permissions for who can view, edit, delete, import, export templates.

Note: The current state of Process Templates only allows for 'view', 'edit' - in regards to updating the template name/description, and 'export'. Other functionality for 'edit' - editing the template in modeler, and 'import' will be added in another ticket.

Solution

  • Create a new middleware that uses the $type parameter to handle xx template permissions.

How to Test

Test A:
Template options do not appear when user has no process template permissions

  1. Run php artisan migrate
  2. Ensure you have templates created under the 'Templates' tab
  3. Create a user with no process template permissions, enable processes permissions
  4. Login as the user
  5. Navigate to the process designer page.

Expected Behavior

  1. The 'Templates' tab does not display for the user
  2. The Ellipses menu in the Process Designer does not display the option to 'Publish a Template'

Test B:
The correct template options appear when the associated permission is enabled for the user

  1. Log in as and Admin
  2. Update the Users process template permissions
  3. Log in as the user
  4. Ensure that you have access to the functionality associated with the enabled permissions.

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.

mcraeteisha and others added 30 commits February 28, 2023 11:18
@mcraeteisha mcraeteisha self-requested a review March 22, 2023 16:43
Copy link
Contributor

@mcraeteisha mcraeteisha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! A user can define permissions for templates, and permissions behave as expected.

@sanjacornelius sanjacornelius merged commit e8feb04 into feature/FOUR-7375 Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants