diff --git a/CHANGELOG.md b/CHANGELOG.md index 00230299..a2624df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Campaign +## 2.6.2 - 2023-05-12 +### Fixed +- Fixed a bug in which non-admin users were not alloyed to edit contacts even with the correct permissions granted ([#378](https://github.com/putyourlightson/craft-campaign/issues/378)). + ## 2.6.1 - 2023-04-28 ### Added - Added the ability to import options fields (multi-select, checkboxes, etc.) into contact fields ([#380](https://github.com/putyourlightson/craft-campaign/issues/380)). diff --git a/composer.json b/composer.json index d432404d..78b64bad 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "putyourlightson/craft-campaign", "description": "Send and manage email campaigns, contacts and mailing lists.", - "version": "2.6.1", + "version": "2.6.2", "type": "craft-plugin", "homepage": "https://putyourlightson.com/plugins/campaign", "license": "proprietary", diff --git a/src/Campaign.php b/src/Campaign.php index 675342ef..5b08bcc5 100644 --- a/src/Campaign.php +++ b/src/Campaign.php @@ -360,10 +360,12 @@ public function userCanEditContacts(): bool return false; } - // Edit permission for the primary site is required to edit contacts - $primarySite = Craft::$app->getSites()->getPrimarySite(); - if (!$currentUser->can('editSite:' . $primarySite->uid)) { - return false; + if (Craft::$app->getIsMultiSite()) { + // Edit permission for the primary site is required to edit contacts + $primarySite = Craft::$app->getSites()->getPrimarySite(); + if (!$currentUser->can('editSite:' . $primarySite->uid)) { + return false; + } } return true;