60 calls to Drupal::currentUser()

BlockContentEntityReferenceSelectionTest::setUp in core/modules/block_content/tests/src/Kernel/BlockContentEntityReferenceSelectionTest.php
BookMultilingualTest::setCurrentLanguage in core/modules/book/tests/src/Kernel/BookMultilingualTest.php
Sets the current language.
book_form_node_form_alter in core/modules/book/book.module
Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
book_node_links_alter in core/modules/book/book.module
Implements hook_node_links_alter().
book_node_prepare_form in core/modules/book/book.module
Implements hook_ENTITY_TYPE_prepare_form() for node entities.
CommentFieldItemList::access in core/modules/comment/src/CommentFieldItemList.php
Checks data value access.
content_moderation_views_query_substitutions in core/modules/content_moderation/content_moderation.views_execution.inc
Implements hook_views_query_substitutions().
content_translation_translate_access in core/modules/content_translation/content_translation.module
Access callback for the translation overview page.
DisplayPluginBase::access in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Determines if the user has access to this display of the view.
DrupalTest::testCurrentUser in core/tests/Drupal/Tests/Core/DrupalTest.php
Tests the currentUser() method.
EntityAccessControlHandler::prepareUser in core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
Loads the current account object, if it does not exist yet.
EntityKernelTestBaseTest::testSetUpCurrentUser in core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php
Tests that the current user is set up correctly.
FieldEntityLinkTest::testEntityLink in core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php
Tests entity link fields.
field_ui_entity_operation in core/modules/field_ui/field_ui.module
Implements hook_entity_operation().
file_validate_size in core/modules/file/file.module
Checks that the file's size is below certain limits.
FilterPluginBase::storeExposedInput in core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
If set to remember exposed input in the session, store it there.
filter_default_format in core/modules/filter/filter.module
Returns the ID of the default text format for a particular user.
FormBase::currentUser in core/lib/Drupal/Core/Form/FormBase.php
Gets the current user.
FormBuilder::currentUser in core/lib/Drupal/Core/Form/FormBuilder.php
Gets the current active user.
FormElementBase::processAutocomplete in core/lib/Drupal/Core/Render/Element/FormElementBase.php
Adds autocomplete functionality to elements.
history_write in core/modules/history/history.module
Updates 'last viewed' timestamp of the specified entity for the current user.
hook_file_url_alter in core/lib/Drupal/Core/File/file.api.php
Alter the URL to a file.
hook_js_settings_alter in core/lib/Drupal/Core/Render/theme.api.php
Perform necessary alterations to the JavaScript settings (drupalSettings).
hook_user_cancel_methods_alter in core/modules/user/user.api.php
Modify account cancellation methods.
hook_views_pre_execute in core/modules/views/views.api.php
Act on the view after the query is built and just before it is executed.
hook_views_pre_view in core/modules/views/views.api.php
Alter a view at the very beginning of Views processing.
language_get_default_langcode in core/modules/language/language.module
Returns the default language code assigned to an entity type and a bundle.
LinkBase::currentUser in core/modules/views/src/Plugin/views/field/LinkBase.php
Gets the current active user.
ListingEmpty::render in core/modules/node/src/Plugin/views/area/ListingEmpty.php
Render the area.
LocaleLookup::getCid in core/modules/locale/src/LocaleLookup.php
Gets the cache ID.
MediaFilterController::preview in core/modules/media/src/Controller/MediaFilterController.php
Returns a HTML response containing a preview of the text after filtering.
media_views_query_substitutions in core/modules/media/media.module
Implements hook_views_query_substitutions().
NodeNewComments::preRender in core/modules/comment/src/Plugin/views/field/NodeNewComments.php
Runs before any fields are rendered.
node_access_view_all_nodes in core/modules/node/node.module
Determines whether the user has a global viewing grant for all nodes.
node_get_recent in core/modules/node/node.module
Finds the most recently changed nodes that are available to the current user.
node_query_node_access_alter in core/modules/node/node.module
Implements hook_query_TAG_alter().
node_views_query_substitutions in core/modules/node/node.views_execution.inc
Implements hook_views_query_substitutions().
olivero_preprocess_field__comment in core/themes/olivero/olivero.theme
Implements hook_preprocess_HOOK() for field--comment.html.twig.
OptionsWidgetBase::getOptions in core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php
Returns the array of options for the widget.
ShortcutLazyBuilders::__construct in core/modules/shortcut/src/ShortcutLazyBuilders.php
Constructs a new ShortcutLazyBuilders object.
ShortcutSet::postSave in core/modules/shortcut/src/Entity/ShortcutSet.php
Acts on a saved entity before the insert or update hook is invoked.
shortcut_current_displayed_set in core/modules/shortcut/shortcut.module
Returns the current displayed shortcut set for the provided user account.
shortcut_default_set in core/modules/shortcut/shortcut.module
Returns the default shortcut set for a given user account.
shortcut_help in core/modules/shortcut/shortcut.module
Implements hook_help().
shortcut_preprocess_page_title in core/modules/shortcut/shortcut.module
Implements hook_preprocess_HOOK() for page title templates.
shortcut_renderable_links in core/modules/shortcut/shortcut.module
Returns an array of shortcut links, suitable for rendering.
shortcut_set_edit_access in core/modules/shortcut/shortcut.module
Access callback for editing a shortcut set.
shortcut_set_switch_access in core/modules/shortcut/shortcut.module
Access callback for switching the shortcut set assigned to a user account.
shortcut_toolbar in core/modules/shortcut/shortcut.module
Implements hook_toolbar().
template_preprocess_forum_list in core/modules/forum/forum.module
Prepares variables for forum list templates.
TemporaryQueryGuard::getAccessCondition in core/modules/jsonapi/src/Access/TemporaryQueryGuard.php
Gets an EntityConditionGroup that filters out inaccessible entities.
TextFormat::currentUser in core/modules/filter/src/Element/TextFormat.php
Wraps the current user.
update_authorize_update_batch_finished in core/modules/update/update.authorize.inc
Batch callback: Performs actions when the authorized update batch is done.
user_js_settings_alter in core/modules/user/user.module
Implements hook_js_settings_alter().
user_logout in core/modules/user/user.module
Logs the current user out.
user_template_preprocess_default_variables_alter in core/modules/user/user.module
Implements hook_template_preprocess_default_variables_alter().
user_toolbar in core/modules/user/user.module
Implements hook_toolbar().
ViewExecutable::__wakeup in core/modules/views/src/ViewExecutable.php
Magic method implementation to unserialize the view executable.
workspaces_toolbar in core/modules/workspaces/workspaces.module
Implements hook_toolbar().
_filter_tips in core/modules/filter/filter.module
Retrieves the filter tips.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.