- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
-
+++ b/modules/contact_permissions/contact_permissions.module @@ -0,0 +1,61 @@ + $entity_types['contact_form']->setAccessClass('\Drupal\contact_permissions\ContactFormAccessControlHandler');
we also need to switch the permissions route provider from
EntityPermissionsRouteProviderWithCheck
toEntityPermissionsRouteProvider
-
+++ b/modules/contact_permissions/src/ContactPermissions.php @@ -0,0 +1,55 @@ +class ContactPermissions {
This needs to use \Drupal\Core\Entity\BundlePermissionHandlerTrait now so that we get the correct dependencies
-
- First commit to issue fork.
- πΊπΈUnited States majorrobot
This seems like a good feature to replace the Contact Form Permissions module (which appears abandoned and doesn't have a supported release anymore). So I'm excited to see it in progress!
I've created a fork/MR from @naveenvalecha's patch in #18 and updated core version requirements.
I've also attempted to address @larowlan's requests in #22.
+++ b/modules/contact_permissions/src/ContactPermissions.php
@@ -0,0 +1,55 @@
+class ContactPermissions {
This needs to use \Drupal\Core\Entity\BundlePermissionHandlerTrait now so that we get the correct dependenciesI've added this, as I understand it -- but this is my first time handling permissions in Drupal 8+, so I may have missed something.
+++ b/modules/contact_permissions/contact_permissions.module
@@ -0,0 +1,61 @@
+ $entity_types['contact_form']->setAccessClass('\Drupal\contact_permissions\ContactFormAccessControlHandler');
we also need to switch the permissions route provider from EntityPermissionsRouteProviderWithCheck to EntityPermissionsRouteProvideI'm actually not following this one -- I don't see where
EntityPermissionsRouteProviderWithCheck
is used. Nor have I been able to figure out the intent of the note with a little research. Happy to make changes if someone could clarify, though.