public function EditableFieldsHelper::checkAccess in Editable Fields 8
Same name and namespace in other branches
- 1.0.x src/services/EditableFieldsHelper.php \Drupal\editablefields\services\EditableFieldsHelper::checkAccess()
Checks if the user can use "editablefields" formatter.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: Entity object.
Return value
bool TRUE if the user can use "editablefields" formatret.
Overrides EditableFieldsHelperInterface::checkAccess
File
- src/
services/ EditableFieldsHelper.php, line 86
Class
- EditableFieldsHelper
- Class EditableFieldsHelper.
Namespace
Drupal\editablefields\servicesCode
public function checkAccess(EntityInterface $entity) {
$can_edit = $entity
->access('edit');
$can_use = $this->currentUser
->hasPermission(self::PERMISSION);
return $can_edit && $can_use;
}