-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Respect access rights for newsletter selection in options i…
…n new/edit view Related: #211
- Loading branch information
1 parent
dc4ad95
commit 69d1bfb
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
namespace In2code\Luxletter\Domain\Service; | ||
|
||
use In2code\Luxletter\Utility\BackendUserUtility; | ||
use TYPO3\CMS\Core\Type\Bitmask\Permission; | ||
|
||
trait PermissionTrait | ||
{ | ||
private function isAuthenticated(array $pageRecord): bool | ||
{ | ||
if (BackendUserUtility::isAdministrator()) { | ||
return true; | ||
} | ||
|
||
$beuserAuthentication = BackendUserUtility::getBackendUserAuthentication(); | ||
return $beuserAuthentication !== null && | ||
$beuserAuthentication->doesUserHaveAccess($pageRecord, Permission::PAGE_SHOW); | ||
} | ||
} |