In Drupal we can specify the user role wise permission for access specific fields value create, edit and delete. This can be achieved by calling the fuction "user_access()" from user core module. This function accepts permission string and user object to check. The function return boolean value TRUE is user has permission else FALSE. Below is the syntax and sample code to use user_access() function.
The Inline entity form is the Drupal Contribute module. Which help to embed a entity form into another entity. Example: Commerce product add form cam be used in Node form. This module will help to create, update and delete entity based on its parent entity. This module embed entity form as the object to its parent form. To alter this specific entity form there is hook called hook_inline_entity_form_entity_form_alter(). Below is the syntax and example to usage of hook_inline_entity_form_entity_form_alter() to alter inline forms.
For Drupal forms we can add Field Groups. These field groups are commonly HTML element, Div, HTML5, Fieldset, Vertical tabs group, Vertical tab, Horizontal tabs group, Horizontal tab, Multipage group, Multipage, Accordion group, Accordion item, Multiple fields container, Multiple fields table and Multiple fields as label-value. We can able to hide Field Groups in Form alter by different methods. Below are some types to hide the Field Groups.
In Drupal we can alter a form using the HOOK, hook_form_alter(). Webforms are used to create forms in interfaces. We can alter webform using hook_form_alter to change field types, label and custom validate or submit for our purposes. The below example will show editing the webform fields and adding custom validate.
In Drupal 7 we can directly configure the Public and Private file at "/admin/config/media/file-system". But in Drupal 8 we cannot directly configure the private file system. To configure Private file system we need to specify the path in our "settings.php". The below steps help to configure Private file system for your Drupal 8.
In Drupal we can able to store files. To save Folder/Directory need to be exist otherwise system through error as Directory not exist. The below sample code help to create Directory/Folder to copy a file. The function "file_prepare_directory()" checks directory exist or not, If exist copying a file otherwise create a directory and copying the file.
In Drupal Node, User, Taxonomy, Files,.. are consider as entity. We can load the Entity information by it ID. There are two types of Entity load mechanisms, a). Entity Object(entity_load()) b). Entity Wrappered Object(entity_metadata_wrapper())
In Drupal 7 we can set permission for each user role on "/admin/people/permissions". These permission are used to restrict and give access to specific features. We can progratically able to assign the permission for the user roles. Below is the sample code how to assign permission programatically.