Example #1
0
 /**
  * Returns a list of node permissions for a given node type.
  *
  * @param \Drupal\rdf_entity\Entity\RdfEntityType $type
  *   The RdfEntity type.
  *
  * @return array
  *   An associative array of permission names and descriptions.
  */
 protected function buildPermissions(RdfEntityType $type)
 {
     $type_id = $type->id();
     $type_params = array('%type_name' => $type->label());
     return array("create {$type_id} rdf entity" => array('title' => $this->t('%type_name: Create new rdf entity', $type_params)), "edit {$type_id} rdf entity" => array('title' => $this->t('%type_name: Edit rdf entity', $type_params)), "delete {$type_id} rdf entity" => array('title' => $this->t('%type_name: Delete rdf entity', $type_params)));
 }
 /**
  * Returns a list of propose permissions for a given Rdf entity type.
  *
  * @param \Drupal\rdf_entity\Entity\RdfEntityType $type
  *   The Rdf type.
  *
  * @return array
  *   An associative array of permission names and descriptions.
  */
 protected function buildProposeRdfTypePermission(RdfEntityType $type)
 {
     $type_id = $type->id();
     $type_params = ['%type_name' => $type->label()];
     return ["propose {$type_id} rdf entity" => ['title' => $this->t('%type_name: Propose new rdf entity', $type_params)]];
 }