October 2017
Intermediate to advanced
566 pages
14h 31m
English
You can easily check whether a given user should access a certain resource as long as you have that user account at hand. Here, you can encounter two scenarios:
As we saw in Chapter 2, Creating Your First Module, the current user is represented by a service, which implements the AccountProxyInterface interface. This service can be accessed by the current_user key or statically with this shorthand:
/** @var AccountProxyInterface $accountProxy */ $accountProxy = \Drupal::currentUser();
From this account proxy, we can request the AccountInterface, which represents the actual logged-in user account (the ...
Read now
Unlock full access