[TYPO3-dev] How to check if BE user is allowed to create records on page X
Georg Ringer
news at ringerge.org
Mon Jan 25 13:03:58 CET 2010
Hi,
Jigal van Hemert schrieb:
> $GLOBALS['BE_USER']->doesUserHaveAccess($row, $perms) maybe [1] ?
> (in t3lib_userAuthGroup)
>
> [1]
> http://www.typo3-unleashed.net/typo3apidocs/latest/de/d3f/classt3lib__userAuthGroup.html#a50682676c8395be6b29853968043e642
ah thanks! In the meanwhile I wrote a custom function
Georg
protected function checkDbMountForAccess($checkedId) {
$access = FALSE;
if ($GLOBALS['BE_USER']->isAdmin()) {
return TRUE;
}
$dbMounts = explode(',',
trim($GLOBALS['BE_USER']->dataLists['webmount_list'], ','));
$access = false;
foreach ($dbMounts as $dbMount) {
$rootline = t3lib_BEfunc::BEgetRootLine($dbMount);
foreach ($rootline as $page) {
if ($page['uid'] === $checkedId && !$access) {
$access = true;
}
}
}
return $access;
}
More information about the TYPO3-dev
mailing list