Skip to content

Conversation

@shahrukh-compuco
Copy link
Contributor

Overview

This PR optimizes the CRM/CiviAwards/Event/Listener/AlterCustomGroupPermission.php event listener by checking the api entity and action before checking for the permissions. For one particular request this does n ot bring much benefit but this was getting called a lot of time in a single page load like contact view and combined for all the calls it does bring some good impact in terms of page load.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the AlterCustomGroupPermission event listener by reordering conditional checks to improve performance. The optimization moves the API entity and action validation before the more expensive permission checks.

  • Reorders conditional logic to check API entity/action before permissions
  • Maintains the same logical behavior while improving performance for frequent calls

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shahrukh-compuco shahrukh-compuco merged commit 302d813 into master Sep 3, 2025
2 checks passed
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.

3 participants