From 0ecb51c551107392932502c8c2190abb470802e5 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Thu, 16 Jan 2020 15:18:49 +0000 Subject: [PATCH] Removing duplicate helper function --- src/Form/AddMediaForm.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/Form/AddMediaForm.php b/src/Form/AddMediaForm.php index 8b545d22..d77029da 100644 --- a/src/Form/AddMediaForm.php +++ b/src/Form/AddMediaForm.php @@ -334,29 +334,4 @@ class AddMediaForm extends FormBase { return AccessResult::forbidden(); } - /** - * Utility function to check if user can create 'Islandora' entity types. - */ - protected function canCreateIslandoraEntity($entity_type, $bundle_type) { - $bundles = $this->entityTypeManager->getStorage($bundle_type)->loadMultiple(); - $access_control_handler = $this->entityTypeManager->getAccessControlHandler($entity_type); - - $allowed = []; - foreach (array_keys($bundles) as $bundle) { - // Skip bundles that aren't 'Islandora' types. - if (!$this->utils->isIslandoraType($entity_type, $bundle)) { - continue; - } - - $access = $access_control_handler->createAccess($bundle, NULL, [], TRUE); - if (!$access->isAllowed()) { - continue; - } - - return TRUE; - } - - return FALSE; - } - }