X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Fparagraphs%2Fmodules%2Fparagraphs_type_permissions%2Fsrc%2FParagraphsTypePermissions.php;fp=web%2Fmodules%2Fcontrib%2Fparagraphs%2Fmodules%2Fparagraphs_type_permissions%2Fsrc%2FParagraphsTypePermissions.php;h=0000000000000000000000000000000000000000;hb=059867c3f96750652c80f39e44c442a58c2549ee;hp=da3ba5f1ff30d2b8e9bf36d61f8b842fdc92e9d8;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2;p=yaffs-website diff --git a/web/modules/contrib/paragraphs/modules/paragraphs_type_permissions/src/ParagraphsTypePermissions.php b/web/modules/contrib/paragraphs/modules/paragraphs_type_permissions/src/ParagraphsTypePermissions.php deleted file mode 100644 index da3ba5f1f..000000000 --- a/web/modules/contrib/paragraphs/modules/paragraphs_type_permissions/src/ParagraphsTypePermissions.php +++ /dev/null @@ -1,80 +0,0 @@ - array( - 'title' => $this->t('Bypass Paragraphs type content access control'), - 'description' => $this->t('Is able to administer content for all Paragraph types'), - ), - ); - } - - /** - * Returns an array of Paragraphs type permissions. - * - * @return array - */ - public function paragraphTypePermissions() { - $perms = array(); - - // Generate paragraph permissions for all Paragraphs types. - foreach (ParagraphsType::loadMultiple() as $type) { - $perms += $this->buildPermissions($type); - } - - return $perms; - } - - /** - * Builds a standard list of node permissions for a given type. - * - * @param \Drupal\paragraphs\Entity\ParagraphsType $type - * The machine name of the node type. - * - * @return array - * An array of permission names and descriptions. - */ - protected function buildPermissions(ParagraphsType $type) { - $type_id = $type->id(); - $type_params = array('%type_name' => $type->label()); - - return array( - 'view paragraph content ' .$type_id => array( - 'title' => $this->t('%type_name: View content', $type_params), - 'description' => $this->t('Is able to view Paragraphs content of type %type_name', $type_params), - ), - 'create paragraph content ' . $type_id => array( - 'title' => $this->t('%type_name: Create content', $type_params), - 'description' => $this->t('Is able to create Paragraphs content of type %type_name', $type_params), - ), - 'update paragraph content ' . $type_id => array( - 'title' => $this->t('%type_name: Edit content', $type_params), - 'description' => $this->t('Is able to update Paragraphs content of type %type_name', $type_params), - ), - 'delete paragraph content ' . $type_id => array( - 'title' => $this->t('%type_name: Delete content', $type_params), - 'description' => $this->t('Is able to delete Paragraphs content of type %type_name', $type_params), - ), - ); - } - -}