130 string references to user.permissions

AccessResult::allowedIfHasPermission in core/lib/Drupal/Core/Access/AccessResult.php
Creates an allowed access result if the permission is present, neutral otherwise.
AccessResult::allowedIfHasPermissions in core/lib/Drupal/Core/Access/AccessResult.php
Creates an allowed access result if the permissions are present, neutral otherwise.
AccessResult::cachePerPermissions in core/lib/Drupal/Core/Access/AccessResult.php
Convenience method, adds the "user.permissions" cache context.
AccessResultTest::testCacheContexts in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@covers ::addCacheContexts @covers ::resetCacheContexts @covers ::getCacheContexts @covers ::cachePerPermissions @covers ::cachePerUser @covers ::allowedIfHasPermission
AccessResultTest::testInheritCacheability in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@covers ::inheritCacheability
AccessResultTest::testOrIfCacheabilityMerging in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@covers ::orIf
AccessTest::testFileAccess in core/modules/file/tests/src/Kernel/AccessTest.php
Tests 'update' and 'delete' access to file entities.
ActionResourceTestBase::getExpectedCacheContexts in core/modules/system/tests/src/Functional/Rest/ActionResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
announcements_feed_toolbar in core/modules/announcements_feed/announcements_feed.module
Implements hook_toolbar().
AnonymousUserResponseSubscriber::onRespond in core/lib/Drupal/Core/EventSubscriber/AnonymousUserResponseSubscriber.php
Adds a cache tag if the 'user.permissions' cache context is present.
AssertPageCacheContextsAndTagsTrait::assertCacheContexts in core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php
Ensures that some cache contexts are present in the current response.
BaseFieldOverrideResourceTestBase::getExpectedCacheContexts in core/tests/Drupal/FunctionalTests/Rest/BaseFieldOverrideResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
BlockContentPermissionsTest::setUp in core/modules/block_content/tests/src/Kernel/BlockContentPermissionsTest.php
BlockTest::getExpectedCacheContexts in core/modules/jsonapi/tests/src/Functional/BlockTest.php
The expected cache contexts for the GET/HEAD response of the test entity.
BlockViewBuilderTest::assertBlockRenderedWithExpectedCacheability in core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
Asserts that a block is built/rendered/cached with expected cacheability.
CacheContextOptimizationTest::testUserPermissionCacheContextOptimization in core/tests/Drupal/KernelTests/Core/Cache/CacheContextOptimizationTest.php
Ensures that 'user.permissions' cache context is able to define cache tags.
CommentCacheTagsTest::getDefaultCacheContexts in core/modules/comment/tests/src/Functional/CommentCacheTagsTest.php
Gets the default cache contexts for rendered entities.
CommentDefaultFormatter::viewElements in core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
Builds a renderable array for a field value.
CommentForm::form in core/modules/comment/src/CommentForm.php
Gets the actual form array to be built.
CommentRssTest::testCommentRss in core/modules/comment/tests/src/Functional/CommentRssTest.php
Tests comments as part of an RSS feed.
CommonCollectionFilterAccessTestPatternsTrait::doTestCollectionFilterAccessBasedOnPermissions in core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php
Implements ::testCollectionFilterAccess() for pure permission-based access.
common_test_page_attachments in core/modules/system/tests/modules/common_test/common_test.module
Implements hook_page_attachments().
common_test_page_attachments_alter in core/modules/system/tests/modules/common_test/common_test.module
Implements hook_page_attachments_alter().
ContactController::contactPersonalPage in core/modules/contact/src/Controller/ContactController.php
Form constructor for the personal contact form.
ContactController::contactSitePage in core/modules/contact/src/Controller/ContactController.php
Presents the site-wide contact form.
ContentLanguageSettingsResourceTestBase::getExpectedCacheContexts in core/modules/language/tests/src/Functional/Rest/ContentLanguageSettingsResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
ContentModerationAccessTest::testAccessCacheability in core/modules/content_moderation/tests/src/Kernel/ContentModerationAccessTest.php
Tests access cacheability.
ContentTranslationWorkflowsTest::testWorkflows in core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
Tests simple and editorial translation workflows.
contextual_preprocess in core/modules/contextual/contextual.module
Implements hook_preprocess().
contextual_toolbar in core/modules/contextual/contextual.module
Implements hook_toolbar().
CookieResourceTestTrait::assertResponseWhenMissingAuthentication in core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php
DateFormatAccessControlHandlerTest::testAccessProvider in core/modules/system/tests/src/Kernel/DateFormatAccessControlHandlerTest.php
DbLogResourceTest::getExpectedUnauthorizedAccessCacheability in core/modules/dblog/tests/src/Functional/DbLogResourceTest.php
Returns the expected cacheability of an unauthorized access response.
DbLogResourceTest::testWatchdog in core/modules/dblog/tests/src/Functional/DbLogResourceTest.php
Writes a log messages and retrieves it via the REST API.
DisplayPathTest::testMenuOptions in core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
Tests the menu and tab option form.
EditorResourceTestBase::getExpectedCacheContexts in core/modules/editor/tests/src/Functional/Rest/EditorResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityCacheTagsTestBase::testReferencedEntity in core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
Tests cache tags presence and invalidation of the entity when referenced.
EntityFormDisplayResourceTestBase::getExpectedCacheContexts in core/tests/Drupal/FunctionalTests/Rest/EntityFormDisplayResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityListBuilderTest::testCacheContexts in core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php
Tests that the correct cache contexts are set.
EntityPermissionsForm::create in core/modules/user/src/Form/EntityPermissionsForm.php
Instantiates a new instance of this class.
EntityReferenceFormatterTest::testLabelFormatter in core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
Tests the label formatter.
EntityResourceTestBase::getExpectedCacheContexts in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityResourceTestBase::getExpectedUnauthorizedAccessCacheability in core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
Returns the expected cacheability of an unauthorized access response.
EntityTestLabelResourceTestBase::getExpectedCacheContexts in core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestLabelResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityTestMapFieldResourceTestBase::getExpectedCacheContexts in core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestMapFieldResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityTestTextItemNormalizerTest::getExpectedCacheContexts in core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityViewDisplayResourceTestBase::getExpectedCacheContexts in core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
EntityWithUriCacheTagsTestBase::getDefaultCacheContexts in core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php
Gets the default cache contexts for rendered entities.
FieldConfigResourceTestBase::getExpectedCacheContexts in core/modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
FieldRenderedEntityTest::assertCacheabilityMetadata in core/modules/views/tests/src/Kernel/Handler/FieldRenderedEntityTest.php
Ensures that the expected cacheability metadata is applied.
FileResourceTestBase::getExpectedCacheContexts in core/modules/file/tests/src/Functional/Rest/FileResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
FileUploadTest::testPostFileUploadAndUseInSingleRequest in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests using the 'file upload and "use" file in single request" POST route.
FilterAPITest::testProcessedTextElement in core/modules/filter/tests/src/Kernel/FilterAPITest.php
Tests the 'processed_text' element.
FilterFormatAccessTest::testFormatPermissions in core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
Tests the Filter format access permissions functionality.
FilterTestCacheMerge::process in core/modules/filter/tests/filter_test/src/Plugin/Filter/FilterTestCacheMerge.php
Performs the filter processing.
FrontPageTest::doTestFrontPageViewCacheTags in core/modules/node/tests/src/Functional/Views/FrontPageTest.php
Tests the cache tags on the front page.
GlossaryTest::testGlossaryView in core/modules/views/tests/src/Functional/GlossaryTest.php
Tests the default glossary view.
HelpController::helpMain in core/modules/help/src/Controller/HelpController.php
Prints a page listing various types of help.
HelpSearch::findResults in core/modules/help/src/Plugin/Search/HelpSearch.php
Finds the search results.
HelpTopicSearchTest::testHelpSearch in core/modules/help/tests/src/Functional/HelpTopicSearchTest.php
Tests help topic search.
hook_menu_local_tasks_alter in core/lib/Drupal/Core/Menu/menu.api.php
Alter local tasks displayed on the page before they are rendered.
jsonapi_test_field_access_entity_field_access in core/modules/jsonapi/tests/modules/jsonapi_test_field_access/jsonapi_test_field_access.module
Implements hook_entity_field_access().
LayoutSectionTest::providerTestLayoutSectionFormatter in core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php
Provides test data for ::testLayoutSectionFormatter().
LazyBuilders::renderAnnouncements in core/modules/announcements_feed/src/LazyBuilders.php
Render announcements.
LinksetControllerTest::testAccess in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Test the access control functionality of the linkset endpoint.
LinksetControllerTest::testCacheability in core/modules/system/tests/src/Functional/Menu/LinksetControllerTest.php
Test the cacheability of the linkset endpoint.
LocalActionManagerTest::getActionsForRouteProvider in core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php
LocalTaskManagerTest::setupNullCacheabilityMetadataValidation in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
LocalTaskManagerTest::testGetTasksBuildWithCacheabilityMetadata in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
@covers ::getTasksBuild
MediaAccessControlHandlerTest::providerAccess in core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
Data provider for testAccess().
MediaAccessControlHandlerTest::providerCreateAccess in core/modules/media/tests/src/Kernel/MediaAccessControlHandlerTest.php
Data provider for testCreateAccess().
MediaAccessTest::testCanonicalMediaAccess in core/modules/media/tests/src/Functional/MediaAccessTest.php
Tests view access control on the canonical page.
MediaAccessTest::testMediaAccess in core/modules/media/tests/src/Functional/MediaAccessTest.php
Tests some access control functionality.
MediaEmbedFilterTest::testFilterIntegration in core/modules/media/tests/src/Kernel/MediaEmbedFilterTest.php
@covers \Drupal\filter\Plugin\Filter\FilterAlign @covers \Drupal\filter\Plugin\Filter\FilterCaption @dataProvider providerFilterIntegration
MediaEmbedFilterTranslationTest::testTranslationSelection in core/modules/media/tests/src/Kernel/MediaEmbedFilterTranslationTest.php
Tests that the expected embedded media entity translation is selected.
MediaLibraryAccessTest::testEditorOpenerAccess in core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
@covers \Drupal\media_library\MediaLibraryEditorOpener::checkAccess
MediaLibraryAccessTest::testFieldWidgetEntityCreateAccess in core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
Tests that the field widget opener respects entity creation permissions.
MediaLibraryAccessTest::testFieldWidgetEntityEditAccess in core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
Tests that the field widget opener respects entity-specific access.
MediaLibraryAccessTest::testFieldWidgetEntityFieldAccess in core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
Tests that the field widget opener respects entity field-level access.
MediaLibraryAccessTest::testViewAccess in core/modules/media_library/tests/src/Kernel/MediaLibraryAccessTest.php
Tests that media library access respects the media_library view.
MediaResourceTestBase::getExpectedCacheContexts in core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
media_library_preprocess_media in core/modules/media_library/media_library.module
Implements hook_preprocess_media().
MenuAccessControlHandlerTest::testAccessProvider in core/modules/system/tests/src/Kernel/MenuAccessControlHandlerTest.php
MenuLinkContentCacheabilityBubblingTest::testOutboundPathAndRouteProcessing in core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
Tests bubbleable metadata of menu links' outbound route/path processing.
MenuLinkContentResourceTestBase::getExpectedCacheContexts in core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
MenuResourceTestBase::getExpectedCacheContexts in core/modules/system/tests/src/Functional/Rest/MenuResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
MenuUiTest::testUnpublishedNodeMenuItem in core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
Tests that menu items pointing to unpublished nodes are editable.
ModulesListForm::create in core/modules/system/src/Form/ModulesListForm.php
Instantiates a new instance of this class.
NavigationRenderer::buildTopBar in core/modules/navigation/src/NavigationRenderer.php
Build the top bar for content entity pages.
NodeAccessCacheabilityTest::testNodeAccessCacheContext in core/modules/node/tests/src/Functional/NodeAccessCacheabilityTest.php
Tests that the user cache contexts are correctly set.
NodeListBuilderTest::testCacheContexts in core/modules/node/tests/src/Kernel/NodeListBuilderTest.php
Tests that the correct cache contexts are set.
NodeResourceTestBase::getExpectedCacheContexts in core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
NodeTest::testGetIndividual in core/modules/jsonapi/tests/src/Functional/NodeTest.php
Tests GETting an individual resource, plus edge cases to ensure good DX.
NodeTypeTest::testNodeTypeCreation in core/modules/node/tests/src/Functional/NodeTypeTest.php
Tests creating a content type programmatically and via a form.
OverrideSectionsTest::testOverrideField in core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php
Tests that the layout override field is not normalized.
PageCacheTagsIntegrationTest::testPageCacheTags in core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php
Tests that cache tags are properly bubbled up to the page level.
PageCacheTest::testPageCacheAnonymousRolePermissions in core/modules/page_cache/tests/src/Functional/PageCacheTest.php
Tests the automatic presence of the anonymous role's cache tag.
PageRenderTest::assertPageRenderHookExceptions in core/modules/system/tests/src/Kernel/Common/PageRenderTest.php
Asserts whether expected exceptions are thrown for invalid hook implementations.
PathBasedBreadcrumbBuilderTest::testBuildWithThreePathElements in core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
Tests the build method with three path elements.
PathBasedBreadcrumbBuilderTest::testBuildWithTwoPathElements in core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
Tests the build method with two path elements.
PathBasedBreadcrumbBuilderTest::testBuildWithUserPath in core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
Tests the breadcrumb for a user path.
Permission::create in core/modules/user/src/Plugin/views/access/Permission.php
Creates an instance of the plugin.
Permission::getCacheContexts in core/modules/user/src/Plugin/views/access/Permission.php
The cache contexts associated with this object.
PermissionAccessCheckTest::providerTestAccess in core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php
Provides data for the testAccess method.
Permissions::create in core/modules/user/src/Plugin/views/filter/Permissions.php
Creates an instance of the plugin.
PermissionsTest::setUp in core/modules/user/tests/src/Unit/Plugin/views/field/PermissionsTest.php
RenderCacheIntegrationTest::testViewAddCacheMetadata in core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
Ensures that saving a view calculates the cache contexts.
RenderCacheTest::testUser1PermissionContext in core/tests/Drupal/KernelTests/Core/Render/RenderCacheTest.php
Tests that user 1 has a different permission context with the same roles.
ResourceTestBase::getExpectedCacheContexts in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
ResourceTestBase::testCollection in core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php
Tests GETting a collection of resources.
RestJsonApiUnsupported::testApiJsonNotSupportedInRest in core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php
Deploying a REST resource using api_json format results in 400 responses.
RestResourceConfigResourceTestBase::getExpectedCacheContexts in core/modules/rest/tests/src/Functional/Rest/RestResourceConfigResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
RouterTest::testFinishResponseSubscriber in core/modules/system/tests/src/Functional/Routing/RouterTest.php
Confirms that our FinishResponseSubscriber logic works properly.
RowRenderCacheTest::doTestRenderedOutput in core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
Check whether the rendered output matches expectations.
RowRenderCacheTest::testNoCaching in core/modules/views/tests/src/Kernel/Plugin/RowRenderCacheTest.php
Tests that rows are not cached when the none cache plugin is used.
settings_tray_toolbar_alter in core/modules/settings_tray/settings_tray.module
Implements hook_toolbar_alter().
shortcut_toolbar in core/modules/shortcut/shortcut.module
Implements hook_toolbar().
SiteMaintenanceModeForm::create in core/modules/system/src/Form/SiteMaintenanceModeForm.php
Instantiates a new instance of this class.
statistics_node_links_alter in core/modules/statistics/statistics.module
Implements hook_node_links_alter().
ToolbarCacheContextsTest::testToolbarCacheContextsCaller in core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php
Tests toolbar cache contexts.
toolbar_page_top in core/modules/toolbar/toolbar.module
Implements hook_page_top().
TourResourceTestBase::getExpectedCacheContexts in core/modules/tour/tests/src/Functional/Rest/TourResourceTestBase.php
The expected cache contexts for the GET/HEAD response of the test entity.
tour_toolbar in core/modules/tour/tour.module
Implements hook_toolbar().
UrlTest::testLinkBubbleableMetadata in core/modules/system/tests/src/Kernel/Common/UrlTest.php
Tests that #type=link bubbles outbound route/path processors' metadata.
UserPermissionsForm::create in core/modules/user/src/Form/UserPermissionsForm.php
Instantiates a new instance of this class.
UserTest::testCollectionFilterAccess in core/modules/jsonapi/tests/src/Functional/UserTest.php
views_add_contextual_links in core/modules/views/views.module
Adds contextual links associated with a view display to a renderable array.
WorkflowAccessControlHandlerTest::checkAccessProvider in core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
Data provider for ::testCheckAccess.
WorkflowAccessControlHandlerTest::testCheckCreateAccess in core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php
@covers ::checkCreateAccess
workspaces_toolbar in core/modules/workspaces/workspaces.module
Implements hook_toolbar().

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