materio_samples.module 566 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * @file
  4. * Contains materio_sapi.module.
  5. */
  6. use Drupal\Core\Routing\RouteMatchInterface;
  7. use Solarium\QueryType\Select\Query\Query;
  8. use Drupal\search_api\Query\QueryInterface;
  9. use Drupal\Core\Template\Attribute;
  10. function materio_samples_form_node_materiau_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id){
  11. // get current user
  12. $user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
  13. if(!$user->hasPermission('materio_samples_edit_materiaux_titles')){
  14. $form['title']['#access'] = false;
  15. }
  16. }