+ /**
+ * Builds a standard list of taxonomy term permissions for a given vocabulary.
+ *
+ * @param \Drupal\taxonomy\VocabularyInterface $vocabulary
+ * The vocabulary.
+ *
+ * @return array
+ * An array of permission names and descriptions.
+ */
+ protected function buildPermissions(VocabularyInterface $vocabulary) {
+ $id = $vocabulary->id();
+ $args = ['%vocabulary' => $vocabulary->label()];
+
+ return [
+ "create terms in $id" => ['title' => $this->t('%vocabulary: Create terms', $args)],
+ "delete terms in $id" => ['title' => $this->t('%vocabulary: Delete terms', $args)],
+ "edit terms in $id" => ['title' => $this->t('%vocabulary: Edit terms', $args)],
+ ];
+ }
+