‪TYPO3CMS  11.5
BackendUserAuthentication.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\CMS\Backend\Utility\BackendUtility;
41 use ‪TYPO3\CMS\Core\SysLog\Error as SystemLogErrorClassification;
43 use ‪TYPO3\CMS\Core\SysLog\Type as SystemLogType;
52 use TYPO3\CMS\Install\Service\SessionService;
53 
62 {
63  public const ‪ROLE_SYSTEMMAINTAINER = 'systemMaintainer';
64 
69  public ‪$usergroup_column = 'usergroup';
70 
75  public ‪$usergroup_table = 'be_groups';
76 
82  public ‪$groupData = [
83  'allowed_languages' => '',
84  'tables_select' => '',
85  'tables_modify' => '',
86  'pagetypes_select' => '',
87  'non_exclude_fields' => '',
88  'explicit_allowdeny' => '',
89  'custom_options' => '',
90  'file_permissions' => '',
91  ];
92 
97  public ‪$userGroupsUID = [];
98 
106  public ‪$workspace = -99;
107 
112  public ‪$workspaceRec = [];
113 
117  protected ‪$userTS = [];
118 
122  protected ‪$userTSUpdated = false;
123 
129  public ‪$errorMsg = '';
130 
136 
140  protected ‪$fileStorages;
141 
145  protected ‪$filePermissions;
146 
151  public ‪$user_table = 'be_users';
152 
157  public ‪$username_column = 'username';
158 
163  public ‪$userident_column = 'password';
164 
169  public ‪$userid_column = 'uid';
170 
174  public ‪$lastLogin_column = 'lastlogin';
175 
179  public ‪$enablecolumns = [
180  'rootLevel' => 1,
181  'deleted' => 'deleted',
182  'disabled' => 'disable',
183  'starttime' => 'starttime',
184  'endtime' => 'endtime',
185  ];
186 
191  public ‪$formfield_uname = 'username';
192 
197  public ‪$formfield_uident = 'userident';
198 
203  public ‪$formfield_status = 'login_status';
204 
209  public ‪$writeStdLog = true;
210 
215  public ‪$writeAttemptLog = true;
216 
221  public ‪$firstMainGroup = 0;
222 
227  public ‪$uc;
228 
239  public ‪$uc_default = [
240  'interfaceSetup' => '',
241  // serialized content that is used to store interface pane and menu positions. Set by the logout.php-script
242  'moduleData' => [],
243  // user-data for the modules
244  'emailMeAtLogin' => 0,
245  'titleLen' => 50,
246  'edit_RTE' => '1',
247  'edit_docModuleUpload' => '1',
248  'resizeTextareas_MaxHeight' => 500,
249  ];
250 
255  public ‪$loginType = 'BE';
256 
260  public function ‪__construct()
261  {
262  $this->name = ‪self::getCookieName();
263  parent::__construct();
264  }
265 
272  public function ‪isAdmin()
273  {
274  return is_array($this->user) && (($this->user['admin'] ?? 0) & 1) == 1;
275  }
276 
286  public function ‪isMemberOfGroup($groupId)
287  {
288  $groupId = (int)$groupId;
289  if (!empty($this->userGroupsUID) && $groupId) {
290  return in_array($groupId, $this->userGroupsUID, true);
291  }
292  return false;
293  }
294 
310  public function ‪doesUserHaveAccess($row, $perms)
311  {
312  $userPerms = $this->‪calcPerms($row);
313  return ($userPerms & $perms) == $perms;
314  }
315 
331  public function ‪isInWebMount($idOrRow, $readPerms = '', $exitOnError = null)
332  {
333  if ($exitOnError !== null) {
334  trigger_error('Calling BackendUserAuthentication->isInWebMount() with the third argument $exitOnError will have no effect anymore in TYPO3 v12.0.', E_USER_DEPRECATED);
335  } else {
336  $exitOnError = 0;
337  }
338  if ($this->‪isAdmin()) {
339  return 1;
340  }
341  $checkRec = [];
342  $fetchPageFromDatabase = true;
343  if (is_array($idOrRow)) {
344  if (!isset($idOrRow['uid'])) {
345  throw new \RuntimeException('The given page record is invalid. Missing uid.', 1578950324);
346  }
347  $checkRec = $idOrRow;
348  $id = (int)$idOrRow['uid'];
349  // ensure the required fields are present on the record
350  if (isset($checkRec['t3ver_oid'], $checkRec[‪$GLOBALS['TCA']['pages']['ctrl']['languageField']], $checkRec[‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']])) {
351  $fetchPageFromDatabase = false;
352  }
353  } else {
354  $id = (int)$idOrRow;
355  }
356  if ($fetchPageFromDatabase) {
357  // Check if input id is an offline version page in which case we will map id to the online version:
358  $checkRec = BackendUtility::getRecord(
359  'pages',
360  $id,
361  't3ver_oid,'
362  . ‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'] . ','
363  . ‪$GLOBALS['TCA']['pages']['ctrl']['languageField']
364  );
365  }
366  if ((int)($checkRec['t3ver_oid'] ?? 0) > 0) {
367  $id = (int)$checkRec['t3ver_oid'];
368  }
369  // if current rec is a translation then get uid from l10n_parent instead
370  // because web mounts point to pages in default language and rootline returns uids of default languages
371  if ((int)($checkRec[‪$GLOBALS['TCA']['pages']['ctrl']['languageField'] ?? null] ?? 0) !== 0
372  && (int)($checkRec[‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'] ?? null] ?? 0) !== 0
373  ) {
374  $id = (int)$checkRec[‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']];
375  }
376  if (!$readPerms) {
377  $readPerms = $this->‪getPagePermsClause(‪Permission::PAGE_SHOW);
378  }
379  if ($id > 0) {
380  $wM = $this->‪returnWebmounts();
381  $rL = BackendUtility::BEgetRootLine($id, ' AND ' . $readPerms, true);
382  foreach ($rL as $v) {
383  if ($v['uid'] && in_array($v['uid'], $wM)) {
384  return $v['uid'];
385  }
386  }
387  }
388  // @deprecated will be removed in TYPO3 v12.0.
389  if ($exitOnError) {
390  throw new \RuntimeException('Access Error: This page is not within your DB-mounts', 1294586445);
391  }
392  return null;
393  }
394 
402  public function ‪modAccess($conf)
403  {
404  $moduleName = $conf['name'] ?? '';
405  if (!BackendUtility::isModuleSetInTBE_MODULES($moduleName)) {
406  throw new \RuntimeException('Fatal Error: This module "' . $moduleName . '" is not enabled in TBE_MODULES', 1294586446);
407  }
408  // Workspaces check:
409  if (
410  !empty($conf['workspaces'])
412  && ($this->workspace !== 0 || !GeneralUtility::inList($conf['workspaces'], 'online'))
413  && ($this->workspace <= 0 || !GeneralUtility::inList($conf['workspaces'], 'custom'))
414  ) {
415  throw new \RuntimeException('Workspace Error: This module "' . $moduleName . '" is not available under the current workspace', 1294586447);
416  }
417  // Throws exception if conf[access] is set to system maintainer and the user is no system maintainer
418  if (str_contains($conf['access'] ?? '', self::ROLE_SYSTEMMAINTAINER) && !$this->‪isSystemMaintainer()) {
419  throw new \RuntimeException('This module "' . $moduleName . '" is only available as system maintainer', 1504804727);
420  }
421  // Returns TRUE if conf[access] is not set at all or if the user is admin
422  if (!($conf['access'] ?? false) || $this->‪isAdmin()) {
423  return true;
424  }
425  // If $conf['access'] is set but not with 'admin' then we return TRUE, if the module is found in the modList
426  $acs = false;
427  if ($moduleName && !str_contains($conf['access'] ?? '', 'admin')) {
428  $acs = $this->‪check('modules', $moduleName);
429  }
430  if (!$acs) {
431  throw new \RuntimeException('Access Error: You don\'t have access to this module.', 1294586448);
432  }
433  // User has access (Otherwise an exception would haven been thrown)
434  return true;
435  }
436 
444  public function ‪isSystemMaintainer(): bool
445  {
446  if (!$this->‪isAdmin()) {
447  return false;
448  }
449 
451  return false;
452  }
453  if (‪Environment::getContext()->isDevelopment()) {
454  return true;
455  }
456  $systemMaintainers = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemMaintainers'] ?? [];
457  $systemMaintainers = array_map('intval', $systemMaintainers);
458  if (!empty($systemMaintainers)) {
459  return in_array((int)$this->user['uid'], $systemMaintainers, true);
460  }
461  // No system maintainers set up yet, so any admin is allowed to access the modules
462  // but explicitly no system maintainers allowed (empty string in TYPO3_CONF_VARS).
463  // @todo: this needs to be adjusted once system maintainers can log into the install tool with their credentials
464  if (isset(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemMaintainers'])
465  && empty(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemMaintainers'])) {
466  return false;
467  }
468  return true;
469  }
470 
487  public function ‪getPagePermsClause($perms)
488  {
489  if (is_array($this->user)) {
490  if ($this->‪isAdmin()) {
491  return ' 1=1';
492  }
493  // Make sure it's integer.
494  $perms = (int)$perms;
495  $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
496  ->getQueryBuilderForTable('pages')
497  ->expr();
498 
499  // User
500  $constraint = $expressionBuilder->orX(
501  $expressionBuilder->comparison(
502  $expressionBuilder->bitAnd('pages.perms_everybody', $perms),
504  $perms
505  ),
506  $expressionBuilder->andX(
507  $expressionBuilder->eq('pages.perms_userid', (int)$this->user['uid']),
508  $expressionBuilder->comparison(
509  $expressionBuilder->bitAnd('pages.perms_user', $perms),
511  $perms
512  )
513  )
514  );
515 
516  // Group (if any is set)
517  if (!empty($this->userGroupsUID)) {
518  $constraint->add(
519  $expressionBuilder->andX(
520  $expressionBuilder->in(
521  'pages.perms_groupid',
522  $this->userGroupsUID
523  ),
524  $expressionBuilder->comparison(
525  $expressionBuilder->bitAnd('pages.perms_group', $perms),
527  $perms
528  )
529  )
530  );
531  }
532 
533  $constraint = ' (' . (string)$constraint . ')';
534 
535  // ****************
536  // getPagePermsClause-HOOK
537  // ****************
538  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getPagePermsClause'] ?? [] as $_funcRef) {
539  $_params = ['currentClause' => $constraint, 'perms' => $perms];
540  $constraint = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
541  }
542  return $constraint;
543  }
544  return ' 1=0';
545  }
546 
556  public function ‪calcPerms($row)
557  {
558  // Return 31 for admin users.
559  if ($this->‪isAdmin()) {
560  return ‪Permission::ALL;
561  }
562  // Return 0 if page is not within the allowed web mount
563  if (!$this->‪isInWebMount($row)) {
564  return ‪Permission::NOTHING;
565  }
566  $out = ‪Permission::NOTHING;
567  if (
568  isset($row['perms_userid']) && isset($row['perms_user']) && isset($row['perms_groupid'])
569  && isset($row['perms_group']) && isset($row['perms_everybody']) && !empty($this->userGroupsUID)
570  ) {
571  if ($this->user['uid'] == $row['perms_userid']) {
572  $out |= $row['perms_user'];
573  }
574  if ($this->‪isMemberOfGroup($row['perms_groupid'])) {
575  $out |= $row['perms_group'];
576  }
577  $out |= $row['perms_everybody'];
578  }
579  // ****************
580  // CALCPERMS hook
581  // ****************
582  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['calcPerms'] ?? [] as $_funcRef) {
583  $_params = [
584  'row' => $row,
585  'outputPermissions' => $out,
586  ];
587  $out = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
588  }
589  return $out;
590  }
591 
598  public function ‪isRTE(): bool
599  {
600  return (bool)($this->uc['edit_RTE'] ?? false);
601  }
602 
612  public function ‪check($type, $value)
613  {
614  return isset($this->groupData[$type])
615  && ($this->‪isAdmin() || GeneralUtility::inList($this->groupData[$type], $value));
616  }
617 
627  public function ‪checkAuthMode($table, $field, $value, $authMode)
628  {
629  // Admin users can do anything:
630  if ($this->‪isAdmin()) {
631  return true;
632  }
633  // Allow all blank values:
634  if ((string)$value === '') {
635  return true;
636  }
637  // Allow dividers:
638  if ($value === '--div--') {
639  return true;
640  }
641  // Certain characters are not allowed in the value
642  if (preg_match('/[:|,]/', $value)) {
643  return false;
644  }
645  // Initialize:
646  $testValue = $table . ':' . $field . ':' . $value;
647  $out = true;
648  // Checking value:
649  switch ((string)$authMode) {
650  case 'explicitAllow':
651  if (!GeneralUtility::inList($this->groupData['explicit_allowdeny'], $testValue . ':ALLOW')) {
652  $out = false;
653  }
654  break;
655  case 'explicitDeny':
656  if (GeneralUtility::inList($this->groupData['explicit_allowdeny'], $testValue . ':DENY')) {
657  $out = false;
658  }
659  break;
660  case 'individual':
661  if (is_array(‪$GLOBALS['TCA'][$table]) && is_array(‪$GLOBALS['TCA'][$table]['columns'][$field])) {
662  $items = ‪$GLOBALS['TCA'][$table]['columns'][$field]['config']['items'];
663  if (is_array($items)) {
664  foreach ($items as $iCfg) {
665  if ((string)$iCfg[1] === (string)$value && ($iCfg[5] ?? '')) {
666  switch ((string)($iCfg[5] ?? '')) {
667  case 'EXPL_ALLOW':
668  if (!GeneralUtility::inList(
669  $this->groupData['explicit_allowdeny'],
670  $testValue . ':ALLOW'
671  )) {
672  $out = false;
673  }
674  break;
675  case 'EXPL_DENY':
676  if (GeneralUtility::inList($this->groupData['explicit_allowdeny'], $testValue . ':DENY')) {
677  $out = false;
678  }
679  break;
680  }
681  break;
682  }
683  }
684  }
685  }
686  break;
687  }
688  return $out;
689  }
690 
697  public function ‪checkLanguageAccess($langValue)
698  {
699  // The users language list must be non-blank - otherwise all languages are allowed.
700  if (trim($this->groupData['allowed_languages']) !== '') {
701  $langValue = (int)$langValue;
702  // Language must either be explicitly allowed OR the lang Value be "-1" (all languages)
703  if ($langValue != -1 && !$this->‪check('allowed_languages', (string)$langValue)) {
704  return false;
705  }
706  }
707  return true;
708  }
709 
717  public function ‪checkFullLanguagesAccess($table, $record)
718  {
719  if (!$this->‪checkLanguageAccess(0)) {
720  return false;
721  }
722 
723  if (BackendUtility::isTableLocalizable($table)) {
724  $pointerField = ‪$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'];
725  $pointerValue = $record[$pointerField] > 0 ? $record[$pointerField] : $record['uid'];
726  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
727  $queryBuilder->getRestrictions()
728  ->removeAll()
729  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
730  ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, (int)$this->workspace));
731  $recordLocalizations = $queryBuilder->select('*')
732  ->from($table)
733  ->where(
734  $queryBuilder->expr()->eq(
735  $pointerField,
736  $queryBuilder->createNamedParameter($pointerValue, ‪Connection::PARAM_INT)
737  )
738  )
739  ->executeQuery()
740  ->fetchAllAssociative();
741 
742  foreach ($recordLocalizations as $recordLocalization) {
743  if (!$this->‪checkLanguageAccess($recordLocalization[‪$GLOBALS['TCA'][$table]['ctrl']['languageField']])) {
744  return false;
745  }
746  }
747  }
748  return true;
749  }
750 
767  public function ‪recordEditAccessInternals($table, $idOrRow, $newRecord = false, $deletedRecord = false, $checkFullLanguageAccess = false): bool
768  {
769  if (!isset(‪$GLOBALS['TCA'][$table])) {
770  return false;
771  }
772  // Always return TRUE for Admin users.
773  if ($this->‪isAdmin()) {
774  return true;
775  }
776  // Fetching the record if the $idOrRow variable was not an array on input:
777  if (!is_array($idOrRow)) {
778  if ($deletedRecord) {
779  $idOrRow = BackendUtility::getRecord($table, $idOrRow, '*', '', false);
780  } else {
781  $idOrRow = BackendUtility::getRecord($table, $idOrRow);
782  }
783  if (!is_array($idOrRow)) {
784  $this->errorMsg = 'ERROR: Record could not be fetched.';
785  return false;
786  }
787  }
788  // Checking languages:
789  if ($table === 'pages' && $checkFullLanguageAccess && !$this->‪checkFullLanguagesAccess($table, $idOrRow)) {
790  return false;
791  }
792  if (‪$GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? false) {
793  // Language field must be found in input row - otherwise it does not make sense.
794  if (isset($idOrRow[‪$GLOBALS['TCA'][$table]['ctrl']['languageField']])) {
795  if (!$this->‪checkLanguageAccess($idOrRow[‪$GLOBALS['TCA'][$table]['ctrl']['languageField']])) {
796  $this->errorMsg = 'ERROR: Language was not allowed.';
797  return false;
798  }
799  if (
800  $checkFullLanguageAccess && $idOrRow[‪$GLOBALS['TCA'][$table]['ctrl']['languageField']] == 0
801  && !$this->‪checkFullLanguagesAccess($table, $idOrRow)
802  ) {
803  $this->errorMsg = 'ERROR: Related/affected language was not allowed.';
804  return false;
805  }
806  } else {
807  $this->errorMsg = 'ERROR: The "languageField" field named "'
808  . ‪$GLOBALS['TCA'][$table]['ctrl']['languageField'] . '" was not found in testing record!';
809  return false;
810  }
811  }
812  // Checking authMode fields:
813  if (is_array(‪$GLOBALS['TCA'][$table]['columns'])) {
814  foreach (‪$GLOBALS['TCA'][$table]['columns'] as $fieldName => $fieldValue) {
815  if (isset($idOrRow[$fieldName])
816  && ($fieldValue['config']['type'] ?? '') === 'select'
817  && ($fieldValue['config']['authMode'] ?? false)
818  && ($fieldValue['config']['authMode_enforce'] ?? '') === 'strict'
819  && !$this->‪checkAuthMode($table, $fieldName, $idOrRow[$fieldName], $fieldValue['config']['authMode'])) {
820  $this->errorMsg = 'ERROR: authMode "' . $fieldValue['config']['authMode']
821  . '" failed for field "' . $fieldName . '" with value "'
822  . $idOrRow[$fieldName] . '" evaluated';
823  return false;
824  }
825  }
826  }
827  // Checking "editlock" feature (doesn't apply to new records)
828  if (!$newRecord && (‪$GLOBALS['TCA'][$table]['ctrl']['editlock'] ?? false)) {
829  if (isset($idOrRow[‪$GLOBALS['TCA'][$table]['ctrl']['editlock']])) {
830  if ($idOrRow[‪$GLOBALS['TCA'][$table]['ctrl']['editlock']]) {
831  $this->errorMsg = 'ERROR: Record was locked for editing. Only admin users can change this state.';
832  return false;
833  }
834  } else {
835  $this->errorMsg = 'ERROR: The "editLock" field named "' . ‪$GLOBALS['TCA'][$table]['ctrl']['editlock']
836  . '" was not found in testing record!';
837  return false;
838  }
839  }
840  // Checking record permissions
841  // THIS is where we can include a check for "perms_" fields for other records than pages...
842  // Process any hooks
843  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['recordEditAccessInternals'] ?? [] as $funcRef) {
844  $params = [
845  'table' => $table,
846  'idOrRow' => $idOrRow,
847  'newRecord' => $newRecord,
848  ];
849  if (!GeneralUtility::callUserFunction($funcRef, $params, $this)) {
850  return false;
851  }
852  }
853  // Finally, return TRUE if all is well.
854  return true;
855  }
856 
862  public function ‪mayMakeShortcut()
863  {
864  return ($this->‪getTSConfig()['options.']['enableBookmarks'] ?? false)
865  && !($this->‪getTSConfig()['options.']['mayNotCreateEditBookmarks'] ?? false);
866  }
867 
877  public function ‪workspaceAllowsLiveEditingInTable(string $table): bool
878  {
879  // In live workspace the record can be added/modified
880  if ($this->workspace === 0) {
881  return true;
882  }
883  // Workspace setting allows to "live edit" records of tables without versioning
884  if (($this->workspaceRec['live_edit'] ?? false)
885  && !BackendUtility::isTableWorkspaceEnabled($table)
886  ) {
887  return true;
888  }
889  // Always for Live workspace AND if live-edit is enabled
890  // and tables are completely without versioning it is ok as well.
891  if (‪$GLOBALS['TCA'][$table]['ctrl']['versioningWS_alwaysAllowLiveEdit'] ?? false) {
892  return true;
893  }
894  // If the answer is FALSE it means the only valid way to create or edit records by creating records in the workspace
895  return false;
896  }
897 
907  public function ‪workspaceCanCreateNewRecord(string $table): bool
908  {
909  // If LIVE records cannot be created due to workspace restrictions, prepare creation of placeholder-record
910  if (!$this->‪workspaceAllowsLiveEditingInTable($table) && !BackendUtility::isTableWorkspaceEnabled($table)) {
911  return false;
912  }
913  return true;
914  }
915 
926  public function ‪workspaceCheckStageForCurrent($stage)
927  {
928  // Always allow for admins
929  if ($this->‪isAdmin()) {
930  return true;
931  }
932  // Always OK for live workspace
933  if ($this->workspace === 0 || !‪ExtensionManagementUtility::isLoaded('workspaces')) {
934  return true;
935  }
936  $stage = (int)$stage;
937  $stat = $this->‪checkWorkspaceCurrent();
938  $accessType = $stat['_ACCESS'];
939  // Workspace owners are always allowed for stage change
940  if ($accessType === 'owner') {
941  return true;
942  }
943 
944  // Check if custom staging is activated
945  ‪$workspaceRec = BackendUtility::getRecord('sys_workspace', $stat['uid']);
946  if (‪$workspaceRec['custom_stages'] > 0 && $stage !== 0 && $stage !== -10) {
947  // Get custom stage record
948  $workspaceStageRec = BackendUtility::getRecord('sys_workspace_stage', $stage);
949  // Check if the user is responsible for the current stage
950  if (
951  $accessType === 'member'
952  && GeneralUtility::inList($workspaceStageRec['responsible_persons'] ?? '', 'be_users_' . $this->user['uid'])
953  ) {
954  return true;
955  }
956  // Check if the user is in a group which is responsible for the current stage
957  foreach ($this->userGroupsUID as $groupUid) {
958  if (
959  $accessType === 'member'
960  && GeneralUtility::inList($workspaceStageRec['responsible_persons'] ?? '', 'be_groups_' . $groupUid)
961  ) {
962  return true;
963  }
964  }
965  } elseif ($stage === -10 || $stage === -20) {
966  // Nobody is allowed to do that except the owner (which was checked above)
967  return false;
968  } elseif (
969  $accessType === 'reviewer' && $stage <= 1
970  || $accessType === 'member' && $stage <= 0
971  ) {
972  return true;
973  }
974  return false;
975  }
976 
988  public function ‪workspacePublishAccess($wsid)
989  {
990  if ($this->‪isAdmin()) {
991  return true;
992  }
993  $wsAccess = $this->‪checkWorkspace($wsid);
994  // If no access to workspace, of course you cannot publish!
995  if ($wsAccess === false) {
996  return false;
997  }
998  if ((int)$wsAccess['uid'] === 0) {
999  // If access to Live workspace, no problem.
1000  return true;
1001  }
1002  // Custom workspaces
1003  // 1. Owners can always publish
1004  if ($wsAccess['_ACCESS'] === 'owner') {
1005  return true;
1006  }
1007  // 2. User has access to online workspace which is OK as well as long as publishing
1008  // access is not limited by workspace option.
1009  return $this->‪checkWorkspace(0) && !($wsAccess['publish_access'] & 2);
1010  }
1011 
1027  public function ‪getTSConfig()
1028  {
1029  return ‪$this->userTS;
1030  }
1031 
1039  public function ‪returnWebmounts()
1040  {
1041  return (string)$this->groupData['webmounts'] != '' ? explode(',', $this->groupData['webmounts']) : [];
1042  }
1043 
1050  public function ‪setWebmounts(array $mountPointUids, $append = false)
1051  {
1052  if (empty($mountPointUids)) {
1053  return;
1054  }
1055  if ($append) {
1056  $currentWebMounts = ‪GeneralUtility::intExplode(',', $this->groupData['webmounts']);
1057  $mountPointUids = array_merge($currentWebMounts, $mountPointUids);
1058  }
1059  $this->groupData['webmounts'] = implode(',', array_unique($mountPointUids));
1060  }
1061 
1073  public function ‪initializeWebmountsForElementBrowser()
1074  {
1075  $alternativeWebmountPoint = (int)$this->‪getSessionData('pageTree_temporaryMountPoint');
1076  if ($alternativeWebmountPoint) {
1077  $alternativeWebmountPoint = ‪GeneralUtility::intExplode(',', (string)$alternativeWebmountPoint);
1078  $this->‪setWebmounts($alternativeWebmountPoint);
1079  return;
1080  }
1081 
1082  $alternativeWebmountPoints = trim($this->‪getTSConfig()['options.']['pageTree.']['altElementBrowserMountPoints'] ?? '');
1083  $appendAlternativeWebmountPoints = $this->‪getTSConfig()['options.']['pageTree.']['altElementBrowserMountPoints.']['append'] ?? '';
1084  if ($alternativeWebmountPoints) {
1085  $alternativeWebmountPoints = ‪GeneralUtility::intExplode(',', $alternativeWebmountPoints);
1086  $this->‪setWebmounts($alternativeWebmountPoints, $appendAlternativeWebmountPoints);
1087  }
1088  }
1089 
1098  public function ‪jsConfirmation($bitmask)
1099  {
1100  try {
1101  $alertPopupsSetting = trim((string)($this->‪getTSConfig()['options.']['alertPopups'] ?? ''));
1102  $alertPopup = ‪JsConfirmation::cast($alertPopupsSetting === '' ? null : (int)$alertPopupsSetting);
1103  } catch (InvalidEnumerationValueException $e) {
1104  $alertPopup = new JsConfirmation();
1105  }
1106 
1107  return ‪JsConfirmation::cast($bitmask)->matches($alertPopup);
1108  }
1109 
1119  public function ‪fetchGroupData()
1120  {
1121  if ($this->user['uid']) {
1122  // Get lists for the be_user record and set them as default/primary values.
1123  // Enabled Backend Modules
1124  $this->groupData['modules'] = $this->user['userMods'] ?? '';
1125  // Add available widgets
1126  $this->groupData['available_widgets'] = $this->user['available_widgets'] ?? '';
1127  // Add allowed mfa providers
1128  $this->groupData['mfa_providers'] = $this->user['mfa_providers'] ?? '';
1129  // Add Allowed Languages
1130  $this->groupData['allowed_languages'] = $this->user['allowed_languages'] ?? '';
1131  // Set user value for workspace permissions.
1132  $this->groupData['workspace_perms'] = $this->user['workspace_perms'] ?? 0;
1133  // Database mountpoints
1134  $this->groupData['webmounts'] = $this->user['db_mountpoints'] ?? '';
1135  // File mountpoints
1136  $this->groupData['filemounts'] = $this->user['file_mountpoints'] ?? '';
1137  // Fileoperation permissions
1138  $this->groupData['file_permissions'] = $this->user['file_permissions'] ?? '';
1139 
1140  // Get the groups and accumulate their permission settings
1141  $mountOptions = new BackendGroupMountOption((int)($this->user['options'] ?? 0));
1142  $groupResolver = GeneralUtility::makeInstance(GroupResolver::class);
1143  $resolvedGroups = $groupResolver->resolveGroupsForUser($this->user, $this->usergroup_table);
1144  foreach ($resolvedGroups as $groupInfo) {
1145  $groupInfo += [
1146  'uid' => 0,
1147  'db_mountpoints' => '',
1148  'file_mountpoints' => '',
1149  'groupMods' => '',
1150  'availableWidgets' => '',
1151  'mfa_providers' => '',
1152  'tables_select' => '',
1153  'tables_modify' => '',
1154  'pagetypes_select' => '',
1155  'non_exclude_fields' => '',
1156  'explicit_allowdeny' => '',
1157  'allowed_languages' => '',
1158  'custom_options' => '',
1159  'file_permissions' => '',
1160  'workspace_perms' => 0, // Bitflag.
1161  ];
1162  // Add the group uid to internal arrays.
1163  $this->userGroupsUID[] = (int)$groupInfo['uid'];
1164  $this->userGroups[(int)$groupInfo['uid']] = $groupInfo;
1165  // Mount group database-mounts
1166  if ($mountOptions->shouldUserIncludePageMountsFromAssociatedGroups()) {
1167  $this->groupData['webmounts'] .= ',' . $groupInfo['db_mountpoints'];
1168  }
1169  // Mount group file-mounts
1170  if ($mountOptions->shouldUserIncludeFileMountsFromAssociatedGroups()) {
1171  $this->groupData['filemounts'] .= ',' . $groupInfo['file_mountpoints'];
1172  }
1173  // Gather permission detail fields
1174  $this->groupData['modules'] .= ',' . $groupInfo['groupMods'];
1175  $this->groupData['available_widgets'] .= ',' . $groupInfo['availableWidgets'];
1176  $this->groupData['mfa_providers'] .= ',' . $groupInfo['mfa_providers'];
1177  $this->groupData['tables_select'] .= ',' . $groupInfo['tables_select'];
1178  $this->groupData['tables_modify'] .= ',' . $groupInfo['tables_modify'];
1179  $this->groupData['pagetypes_select'] .= ',' . $groupInfo['pagetypes_select'];
1180  $this->groupData['non_exclude_fields'] .= ',' . $groupInfo['non_exclude_fields'];
1181  $this->groupData['explicit_allowdeny'] .= ',' . $groupInfo['explicit_allowdeny'];
1182  $this->groupData['allowed_languages'] .= ',' . $groupInfo['allowed_languages'];
1183  $this->groupData['custom_options'] .= ',' . $groupInfo['custom_options'];
1184  $this->groupData['file_permissions'] .= ',' . $groupInfo['file_permissions'];
1185  // Setting workspace permissions:
1186  $this->groupData['workspace_perms'] |= $groupInfo['workspace_perms'];
1187  if (!$this->firstMainGroup) {
1188  $this->firstMainGroup = (int)$groupInfo['uid'];
1189  }
1190  }
1191 
1192  // Populating the $this->userGroupsUID -array with the groups in the order in which they were LAST included.!!
1193  // Finally this is the list of group_uid's in the order they are parsed (including subgroups!)
1194  // and without duplicates (duplicates are presented with their last entrance in the list,
1195  // which thus reflects the order of the TypoScript in TSconfig)
1196  $this->userGroupsUID = array_reverse(array_unique(array_reverse($this->userGroupsUID)));
1197 
1198  $this->‪prepareUserTsConfig();
1199 
1200  // Processing webmounts
1201  // Admin's always have the root mounted
1202  if ($this->‪isAdmin() && !($this->‪getTSConfig()['options.']['dontMountAdminMounts'] ?? false)) {
1203  $this->groupData['webmounts'] = '0,' . $this->groupData['webmounts'];
1204  }
1205  // The lists are cleaned for duplicates
1206  $this->groupData['webmounts'] = ‪StringUtility::uniqueList($this->groupData['webmounts'] ?? '');
1207  $this->groupData['pagetypes_select'] = ‪StringUtility::uniqueList($this->groupData['pagetypes_select'] ?? '');
1208  $this->groupData['tables_select'] = ‪StringUtility::uniqueList(($this->groupData['tables_modify'] ?? '') . ',' . ($this->groupData['tables_select'] ?? ''));
1209  $this->groupData['tables_modify'] = ‪StringUtility::uniqueList($this->groupData['tables_modify'] ?? '');
1210  $this->groupData['non_exclude_fields'] = ‪StringUtility::uniqueList($this->groupData['non_exclude_fields'] ?? '');
1211  $this->groupData['explicit_allowdeny'] = ‪StringUtility::uniqueList($this->groupData['explicit_allowdeny'] ?? '');
1212  $this->groupData['allowed_languages'] = ‪StringUtility::uniqueList($this->groupData['allowed_languages'] ?? '');
1213  $this->groupData['custom_options'] = ‪StringUtility::uniqueList($this->groupData['custom_options'] ?? '');
1214  $this->groupData['modules'] = ‪StringUtility::uniqueList($this->groupData['modules'] ?? '');
1215  $this->groupData['available_widgets'] = ‪StringUtility::uniqueList($this->groupData['available_widgets'] ?? '');
1216  $this->groupData['mfa_providers'] = ‪StringUtility::uniqueList($this->groupData['mfa_providers'] ?? '');
1217  $this->groupData['file_permissions'] = ‪StringUtility::uniqueList($this->groupData['file_permissions'] ?? '');
1218 
1219  // Check if the user access to all web mounts set
1220  if (!empty(trim($this->groupData['webmounts']))) {
1221  $validWebMounts = $this->‪filterValidWebMounts($this->groupData['webmounts']);
1222  $this->groupData['webmounts'] = implode(',', $validWebMounts);
1223  }
1224  // Setting up workspace situation (after webmounts are processed!):
1225  $this->‪workspaceInit();
1226  }
1227  }
1228 
1237  protected function ‪filterValidWebMounts(string $listOfWebMounts): array
1238  {
1239  // Checking read access to web mounts if there are mounts points (not empty string, false or 0)
1240  $allWebMounts = explode(',', $listOfWebMounts);
1241  // Selecting all web mounts with permission clause for reading
1242  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
1243  $queryBuilder->getRestrictions()
1244  ->removeAll()
1245  ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
1246 
1247  $readablePagesOfWebMounts = $queryBuilder->select('uid')
1248  ->from('pages')
1249  // @todo DOCTRINE: check how to make getPagePermsClause() portable
1250  ->where(
1252  $queryBuilder->expr()->in(
1253  'uid',
1254  $queryBuilder->createNamedParameter(
1255  ‪GeneralUtility::intExplode(',', $listOfWebMounts),
1256  Connection::PARAM_INT_ARRAY
1257  )
1258  )
1259  )
1260  ->executeQuery()
1261  ->fetchAllAssociative();
1262  $readablePagesOfWebMounts = array_column(($readablePagesOfWebMounts ?: []), 'uid', 'uid');
1263  foreach ($allWebMounts as $key => $mountPointUid) {
1264  // If the mount ID is NOT found among selected pages, unset it:
1265  if ($mountPointUid > 0 && !isset($readablePagesOfWebMounts[$mountPointUid])) {
1266  unset($allWebMounts[$key]);
1267  }
1268  }
1269  return $allWebMounts;
1270  }
1271 
1276  protected function ‪prepareUserTsConfig(): void
1277  {
1278  $collectedUserTSconfig = [
1279  'default' => ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'],
1280  ];
1281  // Default TSconfig for admin-users
1282  if ($this->‪isAdmin()) {
1283  $collectedUserTSconfig[] = 'admPanel.enable.all = 1';
1284  }
1285  // Setting defaults for sys_note author / email
1286  $collectedUserTSconfig[] = '
1287 TCAdefaults.sys_note.author = ' . $this->user['realName'] . '
1288 TCAdefaults.sys_note.email = ' . $this->user['email'];
1289 
1290  // Loop through all groups and add their 'TSconfig' fields
1291  foreach ($this->userGroupsUID as $groupId) {
1292  $collectedUserTSconfig['group_' . $groupId] = $this->userGroups[$groupId]['TSconfig'] ?? '';
1293  }
1294 
1295  $collectedUserTSconfig[] = $this->user['TSconfig'];
1296  // Check external files
1297  $collectedUserTSconfig = ‪TypoScriptParser::checkIncludeLines_array($collectedUserTSconfig);
1298  // Imploding with "[global]" will make sure that non-ended confinements with braces are ignored.
1299  $userTS_text = implode("\n[GLOBAL]\n", $collectedUserTSconfig);
1300  // Parsing the user TSconfig (or getting from cache)
1301  $hash = md5('userTS:' . $userTS_text);
1302  $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('hash');
1303  if (!($this->userTS = $cache->get($hash))) {
1304  $parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
1305  $conditionMatcher = GeneralUtility::makeInstance(ConditionMatcher::class);
1306  $parseObj->parse($userTS_text, $conditionMatcher);
1307  $this->userTS = $parseObj->setup;
1308  $cache->set($hash, $this->userTS, ['UserTSconfig'], 0);
1309  // Ensure to update UC later
1310  $this->userTSUpdated = true;
1311  }
1312  }
1313 
1318  protected function ‪initializeFileStorages()
1319  {
1320  $this->fileStorages = [];
1321  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
1322  // Admin users have all file storages visible, without any filters
1323  if ($this->‪isAdmin()) {
1324  $storageObjects = $storageRepository->findAll();
1325  foreach ($storageObjects as $storageObject) {
1326  $this->fileStorages[$storageObject->getUid()] = $storageObject;
1327  }
1328  } else {
1329  // Regular users only have storages that are defined in their filemounts
1330  // Permissions and file mounts for the storage are added in StoragePermissionAspect
1331  foreach ($this->‪getFileMountRecords() as $row) {
1332  if (!array_key_exists((int)$row['base'], $this->fileStorages)) {
1333  $storageObject = $storageRepository->findByUid($row['base']);
1334  if ($storageObject) {
1335  $this->fileStorages[$storageObject->getUid()] = $storageObject;
1336  }
1337  }
1338  }
1339  }
1340 
1341  // This has to be called always in order to set certain filters
1343  }
1344 
1351  public function ‪getCategoryMountPoints()
1352  {
1353  $categoryMountPoints = '';
1354 
1355  // Category mounts of the groups
1356  if (is_array($this->userGroups)) {
1357  foreach ($this->userGroups as $group) {
1358  if ($group['category_perms']) {
1359  $categoryMountPoints .= ',' . $group['category_perms'];
1360  }
1361  }
1362  }
1363 
1364  // Category mounts of the user record
1365  if ($this->user['category_perms']) {
1366  $categoryMountPoints .= ',' . $this->user['category_perms'];
1367  }
1368 
1369  // Make the ids unique
1370  $categoryMountPoints = ‪GeneralUtility::trimExplode(',', $categoryMountPoints);
1371  $categoryMountPoints = array_filter($categoryMountPoints); // remove empty value
1372  $categoryMountPoints = array_unique($categoryMountPoints); // remove unique value
1373 
1374  return $categoryMountPoints;
1375  }
1376 
1384  public function ‪getFileMountRecords()
1385  {
1386  $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
1387  $fileMountRecordCache = $runtimeCache->get('backendUserAuthenticationFileMountRecords') ?: [];
1388 
1389  if (!empty($fileMountRecordCache)) {
1390  return $fileMountRecordCache;
1391  }
1392 
1393  $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
1394 
1395  // Processing file mounts (both from the user and the groups)
1396  $fileMounts = array_unique(‪GeneralUtility::intExplode(',', $this->groupData['filemounts'] ?? '', true));
1397 
1398  // Limit file mounts if set in workspace record
1399  if ($this->workspace > 0 && !empty($this->workspaceRec['file_mountpoints'])) {
1400  $workspaceFileMounts = ‪GeneralUtility::intExplode(',', $this->workspaceRec['file_mountpoints'], true);
1401  $fileMounts = array_intersect($fileMounts, $workspaceFileMounts);
1402  }
1403 
1404  if (!empty($fileMounts)) {
1405  $orderBy = ‪$GLOBALS['TCA']['sys_filemounts']['ctrl']['default_sortby'] ?? 'sorting';
1406 
1407  $queryBuilder = $connectionPool->getQueryBuilderForTable('sys_filemounts');
1408  $queryBuilder->getRestrictions()
1409  ->removeAll()
1410  ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
1411  ->add(GeneralUtility::makeInstance(HiddenRestriction::class))
1412  ->add(GeneralUtility::makeInstance(RootLevelRestriction::class));
1413 
1414  $queryBuilder->select('*')
1415  ->from('sys_filemounts')
1416  ->where(
1417  $queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter($fileMounts, Connection::PARAM_INT_ARRAY))
1418  );
1419 
1420  foreach (‪QueryHelper::parseOrderBy($orderBy) as $fieldAndDirection) {
1421  $queryBuilder->addOrderBy(...$fieldAndDirection);
1422  }
1423 
1424  $fileMountRecords = $queryBuilder->executeQuery()->fetchAllAssociative();
1425  if ($fileMountRecords !== false) {
1426  foreach ($fileMountRecords as $fileMount) {
1427  $fileMountRecordCache[$fileMount['base'] . $fileMount['path']] = $fileMount;
1428  }
1429  }
1430  }
1431 
1432  // Read-only file mounts
1433  $readOnlyMountPoints = \trim($this->‪getTSConfig()['options.']['folderTree.']['altElementBrowserMountPoints'] ?? '');
1434  if ($readOnlyMountPoints) {
1435  // We cannot use the API here but need to fetch the default storage record directly
1436  // to not instantiate it (which directly applies mount points) before all mount points are resolved!
1437  $queryBuilder = $connectionPool->getQueryBuilderForTable('sys_file_storage');
1438  $defaultStorageRow = $queryBuilder->select('uid')
1439  ->from('sys_file_storage')
1440  ->where(
1441  $queryBuilder->expr()->eq('is_default', $queryBuilder->createNamedParameter(1, ‪Connection::PARAM_INT))
1442  )
1443  ->setMaxResults(1)
1444  ->executeQuery()
1445  ->fetchAssociative();
1446 
1447  $readOnlyMountPointArray = ‪GeneralUtility::trimExplode(',', $readOnlyMountPoints);
1448  foreach ($readOnlyMountPointArray as $readOnlyMountPoint) {
1449  $readOnlyMountPointConfiguration = ‪GeneralUtility::trimExplode(':', $readOnlyMountPoint);
1450  if (count($readOnlyMountPointConfiguration) === 2) {
1451  // A storage is passed in the configuration
1452  $storageUid = (int)$readOnlyMountPointConfiguration[0];
1453  $path = $readOnlyMountPointConfiguration[1];
1454  } else {
1455  if (empty($defaultStorageRow)) {
1456  throw new \RuntimeException('Read only mount points have been defined in User TsConfig without specific storage, but a default storage could not be resolved.', 1404472382);
1457  }
1458  // Backwards compatibility: If no storage is passed, we use the default storage
1459  $storageUid = $defaultStorageRow['uid'];
1460  $path = $readOnlyMountPointConfiguration[0];
1461  }
1462  $fileMountRecordCache[$storageUid . $path] = [
1463  'base' => $storageUid,
1464  'title' => $path,
1465  'path' => $path,
1466  'read_only' => true,
1467  ];
1468  }
1469  }
1470 
1471  // Personal or Group filemounts are not accessible if file mount list is set in workspace record
1472  if ($this->workspace <= 0 || empty($this->workspaceRec['file_mountpoints'])) {
1473  // If userHomePath is set, we attempt to mount it
1474  if (‪$GLOBALS['TYPO3_CONF_VARS']['BE']['userHomePath']) {
1475  [$userHomeStorageUid, $userHomeFilter] = explode(':', ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['userHomePath'], 2);
1476  $userHomeStorageUid = (int)$userHomeStorageUid;
1477  $userHomeFilter = '/' . ltrim($userHomeFilter, '/');
1478  if ($userHomeStorageUid > 0) {
1479  // Try and mount with [uid]_[username]
1480  $path = $userHomeFilter . $this->user['uid'] . '_' . $this->user['username'] . ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['userUploadDir'];
1481  $fileMountRecordCache[$userHomeStorageUid . $path] = [
1482  'base' => $userHomeStorageUid,
1483  'title' => $this->user['username'],
1484  'path' => $path,
1485  'read_only' => false,
1486  'user_mount' => true,
1487  ];
1488  // Try and mount with only [uid]
1489  $path = $userHomeFilter . $this->user['uid'] . ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['userUploadDir'];
1490  $fileMountRecordCache[$userHomeStorageUid . $path] = [
1491  'base' => $userHomeStorageUid,
1492  'title' => $this->user['username'],
1493  'path' => $path,
1494  'read_only' => false,
1495  'user_mount' => true,
1496  ];
1497  }
1498  }
1499 
1500  // Mount group home-dirs
1501  $mountOptions = new BackendGroupMountOption((int)($this->user['options'] ?? 0));
1502  if (‪$GLOBALS['TYPO3_CONF_VARS']['BE']['groupHomePath'] !== '' && $mountOptions->shouldUserIncludeFileMountsFromAssociatedGroups()) {
1503  // If groupHomePath is set, we attempt to mount it
1504  [$groupHomeStorageUid, $groupHomeFilter] = explode(':', ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['groupHomePath'], 2);
1505  $groupHomeStorageUid = (int)$groupHomeStorageUid;
1506  $groupHomeFilter = '/' . ltrim($groupHomeFilter, '/');
1507  if ($groupHomeStorageUid > 0) {
1508  foreach ($this->userGroups as ‪$groupData) {
1509  $path = $groupHomeFilter . ‪$groupData['uid'];
1510  $fileMountRecordCache[$groupHomeStorageUid . $path] = [
1511  'base' => $groupHomeStorageUid,
1512  'title' => ‪$groupData['title'],
1513  'path' => $path,
1514  'read_only' => false,
1515  'user_mount' => true,
1516  ];
1517  }
1518  }
1519  }
1520  }
1521 
1522  $runtimeCache->set('backendUserAuthenticationFileMountRecords', $fileMountRecordCache);
1523  return $fileMountRecordCache;
1524  }
1525 
1533  public function ‪getFileStorages()
1534  {
1535  // Initializing file mounts after the groups are fetched
1536  if ($this->fileStorages === null) {
1537  $this->‪initializeFileStorages();
1538  }
1539  return ‪$this->fileStorages;
1540  }
1541 
1548  {
1549  // Add the option for also displaying the non-hidden files
1550  if ($this->uc['showHiddenFilesAndFolders'] ?? false) {
1552  }
1553  }
1554 
1590  public function ‪getFilePermissions()
1591  {
1592  if (!isset($this->filePermissions)) {
1594  // File permissions
1595  'addFile' => false,
1596  'readFile' => false,
1597  'writeFile' => false,
1598  'copyFile' => false,
1599  'moveFile' => false,
1600  'renameFile' => false,
1601  'deleteFile' => false,
1602  // Folder permissions
1603  'addFolder' => false,
1604  'readFolder' => false,
1605  'writeFolder' => false,
1606  'copyFolder' => false,
1607  'moveFolder' => false,
1608  'renameFolder' => false,
1609  'deleteFolder' => false,
1610  'recursivedeleteFolder' => false,
1611  ];
1612  if ($this->‪isAdmin()) {
1613  ‪$filePermissions = array_map('is_bool', ‪$filePermissions);
1614  } else {
1615  $userGroupRecordPermissions = ‪GeneralUtility::trimExplode(',', $this->groupData['file_permissions'] ?? '', true);
1616  array_walk(
1617  $userGroupRecordPermissions,
1618  static function ($permission) use (&‪$filePermissions) {
1619  ‪$filePermissions[$permission] = true;
1620  }
1621  );
1622 
1623  // Finally overlay any userTSconfig
1624  $permissionsTsConfig = $this->‪getTSConfig()['permissions.']['file.']['default.'] ?? [];
1625  if (!empty($permissionsTsConfig)) {
1626  array_walk(
1627  $permissionsTsConfig,
1628  static function ($value, $permission) use (&‪$filePermissions) {
1629  ‪$filePermissions[$permission] = (bool)$value;
1630  }
1631  );
1632  }
1633  }
1634  $this->filePermissions = ‪$filePermissions;
1635  }
1637  }
1638 
1648  public function ‪getFilePermissionsForStorage(ResourceStorage $storageObject)
1649  {
1650  $finalUserPermissions = $this->‪getFilePermissions();
1651  if (!$this->‪isAdmin()) {
1652  $storageFilePermissions = $this->‪getTSConfig()['permissions.']['file.']['storage.'][$storageObject->getUid() . '.'] ?? [];
1653  if (!empty($storageFilePermissions)) {
1654  array_walk(
1655  $storageFilePermissions,
1656  static function ($value, $permission) use (&$finalUserPermissions) {
1657  $finalUserPermissions[$permission] = (bool)$value;
1658  }
1659  );
1660  }
1661  }
1662  return $finalUserPermissions;
1663  }
1664 
1682  public function ‪getDefaultUploadFolder($pid = null, $table = null, $field = null)
1683  {
1684  $uploadFolder = $this->‪getTSConfig()['options.']['defaultUploadFolder'] ?? '';
1685  if ($uploadFolder) {
1686  try {
1687  $uploadFolder = GeneralUtility::makeInstance(ResourceFactory::class)->getFolderObjectFromCombinedIdentifier($uploadFolder);
1688  } catch (FolderDoesNotExistException $e) {
1689  $uploadFolder = null;
1690  }
1691  }
1692  if (empty($uploadFolder)) {
1693  foreach ($this->‪getFileStorages() as $storage) {
1694  if ($storage->isDefault() && $storage->isWritable()) {
1695  try {
1696  $uploadFolder = $storage->getDefaultFolder();
1697  if ($uploadFolder->checkActionPermission('write')) {
1698  break;
1699  }
1700  $uploadFolder = null;
1701  } catch (Exception $folderAccessException) {
1702  // If the folder is not accessible (no permissions / does not exist) we skip this one.
1703  }
1704  break;
1705  }
1706  }
1707  if (!$uploadFolder instanceof Folder) {
1708  foreach ($this->‪getFileStorages() as $storage) {
1709  if ($storage->isWritable()) {
1710  try {
1711  $uploadFolder = $storage->getDefaultFolder();
1712  if ($uploadFolder->checkActionPermission('write')) {
1713  break;
1714  }
1715  $uploadFolder = null;
1716  } catch (Exception $folderAccessException) {
1717  // If the folder is not accessible (no permissions / does not exist) try the next one.
1718  }
1719  }
1720  }
1721  }
1722  }
1723 
1724  // HOOK: getDefaultUploadFolder
1725  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder'] ?? [] as $_funcRef) {
1726  $_params = [
1727  'uploadFolder' => $uploadFolder,
1728  'pid' => $pid,
1729  'table' => $table,
1730  'field' => $field,
1731  ];
1732  $uploadFolder = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1733  }
1734 
1735  if ($uploadFolder instanceof Folder) {
1736  return $uploadFolder;
1737  }
1738  return false;
1739  }
1740 
1749  public function ‪getDefaultUploadTemporaryFolder()
1750  {
1751  $defaultTemporaryFolder = null;
1752  $defaultFolder = $this->‪getDefaultUploadFolder();
1753 
1754  if ($defaultFolder !== false) {
1755  $tempFolderName = '_temp_';
1756  $createFolder = !$defaultFolder->hasFolder($tempFolderName);
1757  if ($createFolder === true) {
1758  try {
1759  $defaultTemporaryFolder = $defaultFolder->createFolder($tempFolderName);
1760  } catch (‪Exception $folderAccessException) {
1761  }
1762  } else {
1763  $defaultTemporaryFolder = $defaultFolder->getSubfolder($tempFolderName);
1764  }
1765  }
1766 
1767  return $defaultTemporaryFolder;
1768  }
1769 
1777  public function ‪workspaceInit()
1778  {
1779  // Initializing workspace by evaluating and setting the workspace, possibly updating it in the user record!
1780  $this->‪setWorkspace($this->user['workspace_id']);
1781  // Limiting the DB mountpoints if there any selected in the workspace record
1783  $allowed_languages = (string)($this->‪getTSConfig()['options.']['workspaces.']['allowed_languages.'][‪$this->workspace] ?? '');
1784  if ($allowed_languages !== '') {
1785  $this->groupData['allowed_languages'] = ‪StringUtility::uniqueList($allowed_languages);
1786  }
1787  }
1788 
1792  protected function ‪initializeDbMountpointsInWorkspace()
1793  {
1794  $dbMountpoints = trim($this->workspaceRec['db_mountpoints'] ?? '');
1795  if ($this->workspace > 0 && $dbMountpoints != '') {
1796  $filteredDbMountpoints = [];
1797  // Notice: We cannot call $this->getPagePermsClause(1);
1798  // as usual because the group-list is not available at this point.
1799  // But bypassing is fine because all we want here is check if the
1800  // workspace mounts are inside the current webmounts rootline.
1801  // The actual permission checking on page level is done elsewhere
1802  // as usual anyway before the page tree is rendered.
1803  $readPerms = '1=1';
1804  // Traverse mount points of the workspace, add them,
1805  // but make sure they match against the users' DB mounts
1806 
1807  $workspaceWebMounts = ‪GeneralUtility::intExplode(',', $dbMountpoints);
1808  $webMountsOfUser = ‪GeneralUtility::intExplode(',', $this->groupData['webmounts']);
1809  $webMountsOfUser = array_combine($webMountsOfUser, $webMountsOfUser) ?: [];
1810 
1811  $entryPointRootLineUids = [];
1812  foreach ($webMountsOfUser as $webMountPageId) {
1813  $rootLine = BackendUtility::BEgetRootLine($webMountPageId, '', true);
1814  $entryPointRootLineUids[$webMountPageId] = array_map('intval', array_column($rootLine, 'uid'));
1815  }
1816  foreach ($entryPointRootLineUids as $webMountOfUser => $uidsOfRootLine) {
1817  // Remove the DB mounts of the user if the DB mount is not in the list of
1818  // workspace mounts
1819  foreach ($workspaceWebMounts as $webmountOfWorkspace) {
1820  // This workspace DB mount is somewhere in the rootline of the users' web mount,
1821  // so this is "OK" to be included
1822  if (in_array($webmountOfWorkspace, $uidsOfRootLine, true)) {
1823  continue;
1824  }
1825  // Remove the user's DB Mount (possible via array_combine, see above)
1826  unset($webMountsOfUser[$webMountOfUser]);
1827  }
1828  }
1829  $dbMountpoints = array_merge($workspaceWebMounts, $webMountsOfUser);
1830  $dbMountpoints = array_unique($dbMountpoints);
1831  foreach ($dbMountpoints as $mpId) {
1832  if ($this->‪isInWebMount($mpId, $readPerms)) {
1833  $filteredDbMountpoints[] = $mpId;
1834  }
1835  }
1836  // Re-insert webmounts
1837  $this->groupData['webmounts'] = implode(',', $filteredDbMountpoints);
1838  }
1839  }
1840 
1849  public function ‪checkWorkspace($wsRec, ‪$fields = '*')
1850  {
1851  $retVal = false;
1852  // If not array, look up workspace record:
1853  if (!is_array($wsRec)) {
1854  switch ((string)$wsRec) {
1855  case '0':
1856  $wsRec = ['uid' => $wsRec];
1857  break;
1858  default:
1859  if (‪ExtensionManagementUtility::isLoaded('workspaces')) {
1860  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_workspace');
1861  $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(RootLevelRestriction::class));
1862  $wsRec = $queryBuilder->select(...‪GeneralUtility::trimExplode(',', ‪$fields))
1863  ->from('sys_workspace')
1864  ->where($queryBuilder->expr()->eq(
1865  'uid',
1866  $queryBuilder->createNamedParameter($wsRec, ‪Connection::PARAM_INT)
1867  ))
1868  ->orderBy('title')
1869  ->setMaxResults(1)
1870  ->executeQuery()
1871  ->fetchAssociative();
1872  }
1873  }
1874  }
1875  // If wsRec is set to an array, evaluate it:
1876  if (is_array($wsRec)) {
1877  if ($this->‪isAdmin()) {
1878  return array_merge($wsRec, ['_ACCESS' => 'admin']);
1879  }
1880  switch ((string)$wsRec['uid']) {
1881  case '0':
1882  $retVal = $this->‪hasEditAccessToLiveWorkspace()
1883  ? array_merge($wsRec, ['_ACCESS' => 'online'])
1884  : false;
1885  break;
1886  default:
1887  // Checking if the guy is admin:
1888  if (GeneralUtility::inList($wsRec['adminusers'], 'be_users_' . $this->user['uid'])) {
1889  return array_merge($wsRec, ['_ACCESS' => 'owner']);
1890  }
1891  // Checking if he is owner through a user group of his:
1892  foreach ($this->userGroupsUID as $groupUid) {
1893  if (GeneralUtility::inList($wsRec['adminusers'], 'be_groups_' . $groupUid)) {
1894  return array_merge($wsRec, ['_ACCESS' => 'owner']);
1895  }
1896  }
1897  // Checking if he is member as user:
1898  if (GeneralUtility::inList($wsRec['members'], 'be_users_' . $this->user['uid'])) {
1899  return array_merge($wsRec, ['_ACCESS' => 'member']);
1900  }
1901  // Checking if he is member through a user group of his:
1902  foreach ($this->userGroupsUID as $groupUid) {
1903  if (GeneralUtility::inList($wsRec['members'], 'be_groups_' . $groupUid)) {
1904  return array_merge($wsRec, ['_ACCESS' => 'member']);
1905  }
1906  }
1907  }
1908  }
1909  return $retVal;
1910  }
1911 
1916  protected function ‪hasEditAccessToLiveWorkspace(): bool
1917  {
1918  return (bool)(($this->groupData['workspace_perms'] ?? 0) & 1);
1919  }
1920 
1929  public function ‪checkWorkspaceCurrent()
1930  {
1931  if (!isset($this->checkWorkspaceCurrent_cache)) {
1932  $this->checkWorkspaceCurrent_cache = $this->‪checkWorkspace($this->workspace);
1933  }
1935  }
1936 
1943  public function ‪setWorkspace($workspaceId)
1944  {
1945  // Check workspace validity and if not found, revert to default workspace.
1946  if (!$this->‪setTemporaryWorkspace($workspaceId)) {
1947  $this->‪setDefaultWorkspace();
1948  }
1949  // Unset access cache:
1950  $this->checkWorkspaceCurrent_cache = null;
1951  // If ID is different from the stored one, change it:
1952  if ((int)$this->workspace !== (int)$this->user['workspace_id']) {
1953  $this->user['workspace_id'] = ‪$this->workspace;
1954  GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('be_users')->update(
1955  'be_users',
1956  ['workspace_id' => $this->user['workspace_id']],
1957  ['uid' => (int)$this->user['uid']]
1958  );
1959  $this->‪writelog(SystemLogType::EXTENSION, SystemLogGenericAction::UNDEFINED, SystemLogErrorClassification::MESSAGE, 0, 'User changed workspace to "{workspace}"', ['workspace' => $this->workspace]);
1960  }
1961  }
1962 
1970  public function ‪setTemporaryWorkspace($workspaceId)
1971  {
1972  $result = false;
1973  $workspaceRecord = $this->‪checkWorkspace($workspaceId);
1974 
1975  if ($workspaceRecord) {
1976  $this->workspaceRec = $workspaceRecord;
1977  $this->workspace = (int)$workspaceId;
1978  $result = true;
1979  }
1980 
1981  return $result;
1982  }
1983 
1988  public function ‪setDefaultWorkspace()
1989  {
1990  $this->workspace = (int)$this->‪getDefaultWorkspace();
1991  $this->workspaceRec = $this->‪checkWorkspace($this->workspace);
1992  }
1993 
2002  public function ‪getDefaultWorkspace()
2003  {
2004  if (!‪ExtensionManagementUtility::isLoaded('workspaces')) {
2005  return 0;
2006  }
2007  // Online is default
2008  if ($this->‪checkWorkspace(0)) {
2009  return 0;
2010  }
2011  // Otherwise -99 is the fallback
2012  $defaultWorkspace = -99;
2013  // Traverse all workspaces
2014  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_workspace');
2015  $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(RootLevelRestriction::class));
2016  $result = $queryBuilder->select('*')
2017  ->from('sys_workspace')
2018  ->orderBy('title')
2019  ->executeQuery();
2020  while ($workspaceRecord = $result->fetchAssociative()) {
2021  if ($this->‪checkWorkspace($workspaceRecord)) {
2022  $defaultWorkspace = (int)$workspaceRecord['uid'];
2023  break;
2024  }
2025  }
2026  return $defaultWorkspace;
2027  }
2028 
2047  public function ‪writelog($type, $action, $error, $details_nr, $details, $data, $tablename = '', $recuid = '', $recpid = '', $event_pid = -1, $NEWid = '', $userId = 0)
2048  {
2049  if (!$userId && !empty($this->user['uid'])) {
2050  $userId = $this->user['uid'];
2051  }
2052 
2053  if ($backuserid = $this->‪getOriginalUserIdWhenInSwitchUserMode()) {
2054  if (empty($data)) {
2055  $data = [];
2056  }
2057  $data['originalUser'] = $backuserid;
2058  }
2059 
2060  // @todo Remove this once this method is properly typed.
2061  $type = (int)$type;
2062 
2063  ‪$fields = [
2064  'userid' => (int)$userId,
2065  'type' => $type,
2066  'channel' => ‪Type::toChannel($type),
2067  'level' => ‪Type::toLevel($type),
2068  'action' => (int)$action,
2069  'error' => (int)$error,
2070  'details_nr' => (int)$details_nr,
2071  'details' => $details,
2072  'log_data' => serialize($data),
2073  'tablename' => $tablename,
2074  'recuid' => (int)$recuid,
2075  'IP' => (string)GeneralUtility::getIndpEnv('REMOTE_ADDR'),
2076  'tstamp' => ‪$GLOBALS['EXEC_TIME'] ?? time(),
2077  'event_pid' => (int)$event_pid,
2078  'NEWid' => $NEWid,
2079  'workspace' => $this->workspace,
2080  ];
2081 
2082  $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_log');
2083  $connection->insert(
2084  'sys_log',
2085  ‪$fields,
2086  [
2103  ]
2104  );
2105 
2106  return (int)$connection->lastInsertId('sys_log');
2107  }
2108 
2115  public static function ‪getCookieName()
2116  {
2117  $configuredCookieName = trim(‪$GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
2118  if (empty($configuredCookieName)) {
2119  $configuredCookieName = 'be_typo_user';
2120  }
2121  return $configuredCookieName;
2122  }
2123 
2134  public function ‪backendCheckLogin($proceedIfNoUserIsLoggedIn = null)
2135  {
2136  if (empty($this->user['uid'])) {
2137  if ($proceedIfNoUserIsLoggedIn === null) {
2138  $proceedIfNoUserIsLoggedIn = false;
2139  } else {
2140  trigger_error('Calling $BE_USER->backendCheckLogin() with a first input argument will not work anymore in TYPO3 v12.0.', E_USER_DEPRECATED);
2141  }
2142  // @todo: throw a proper AccessDeniedException in TYPO3 v12.0. and handle this functionality in the calling code
2143  if ($proceedIfNoUserIsLoggedIn === false) {
2144  $url = ‪$GLOBALS['TYPO3_REQUEST']->getAttribute('normalizedParams')->getSiteUrl() . TYPO3_mainDir;
2145  throw new ImmediateResponseException(new RedirectResponse($url, 303), 1607271747);
2146  }
2147  } elseif ($this->‪isUserAllowedToLogin()) {
2148  $this->‪initializeBackendLogin();
2149  } else {
2150  // @todo: throw a proper AccessDeniedException in TYPO3 v12.0.
2151  throw new \RuntimeException('Login Error: TYPO3 is in maintenance mode at the moment. Only administrators are allowed access.', 1294585860);
2152  }
2153  }
2154 
2158  public function ‪initializeBackendLogin(): void
2159  {
2160  // The groups are fetched and ready for permission checking in this initialization.
2161  // Tables.php must be read before this because stuff like the modules has impact in this
2163  // Setting the UC array. It's needed with fetchGroupData first, due to default/overriding of values.
2164  $this->‪backendSetUC();
2165  if ($this->loginSessionStarted) {
2166  // Also, if there is a recovery link set, unset it now
2167  // this will be moved into its own Event at a later stage.
2168  // If a token was set previously, this is now unset, as it was now possible to log-in
2169  if ($this->user['password_reset_token'] ?? '') {
2170  GeneralUtility::makeInstance(ConnectionPool::class)
2171  ->getConnectionForTable($this->user_table)
2172  ->update($this->user_table, ['password_reset_token' => ''], ['uid' => $this->user['uid']]);
2173  }
2174  // Process hooks
2175  $hooks = ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['backendUserLogin'];
2176  foreach ($hooks ?? [] as $_funcRef) {
2177  $_params = ['user' => ‪$this->user];
2178  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
2179  }
2180  }
2181  }
2182 
2189  public function ‪backendSetUC()
2190  {
2191  // UC - user configuration is a serialized array inside the user object
2192  // If there is a saved uc we implement that instead of the default one.
2193  $this->‪unpack_uc();
2194  // Setting defaults if uc is empty
2195  $updated = false;
2196  if (!is_array($this->uc)) {
2197  $this->uc = array_merge(
2198  $this->uc_default,
2199  (array)‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUC'],
2200  GeneralUtility::removeDotsFromTS((array)($this->‪getTSConfig()['setup.']['default.'] ?? []))
2201  );
2202  $this->‪overrideUC();
2203  $updated = true;
2204  }
2205  // If TSconfig is updated, update the defaultUC.
2206  if ($this->userTSUpdated) {
2207  $this->‪overrideUC();
2208  $updated = true;
2209  }
2210  // Setting default lang from be_user record, also update for backwards-compatibility
2211  // @deprecated This will be removed in TYPO3 v12
2212  if (!isset($this->uc['lang']) || $this->uc['lang'] !== $this->user['lang']) {
2213  $this->uc['lang'] = $this->user['lang'];
2214  $updated = true;
2215  }
2216  // Setting the time of the first login:
2217  if (!isset($this->uc['firstLoginTimeStamp'])) {
2218  $this->uc['firstLoginTimeStamp'] = ‪$GLOBALS['EXEC_TIME'];
2219  $updated = true;
2220  }
2221  // Saving if updated.
2222  if ($updated) {
2223  $this->‪writeUC();
2224  }
2225  }
2226 
2233  public function ‪overrideUC()
2234  {
2235  $this->uc = array_merge((array)$this->uc, (array)($this->‪getTSConfig()['setup.']['override.'] ?? []));
2236  }
2237 
2243  public function ‪resetUC()
2244  {
2245  $this->user['uc'] = '';
2246  $this->uc = '';
2247  $this->‪backendSetUC();
2248  }
2249 
2262  public function ‪isUserAllowedToLogin()
2263  {
2264  $isUserAllowedToLogin = false;
2265  $adminOnlyMode = (int)‪$GLOBALS['TYPO3_CONF_VARS']['BE']['adminOnly'];
2266  // Backend user is allowed if adminOnly is not set or user is an admin:
2267  if (!$adminOnlyMode || $this->‪isAdmin()) {
2268  $isUserAllowedToLogin = true;
2269  } elseif ($backUserId = $this->‪getOriginalUserIdWhenInSwitchUserMode()) {
2270  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
2271  $isUserAllowedToLogin = (bool)$queryBuilder->count('uid')
2272  ->from('be_users')
2273  ->where(
2274  $queryBuilder->expr()->eq(
2275  'uid',
2276  $queryBuilder->createNamedParameter($backUserId, ‪Connection::PARAM_INT)
2277  ),
2278  $queryBuilder->expr()->eq('admin', $queryBuilder->createNamedParameter(1, ‪Connection::PARAM_INT))
2279  )
2280  ->executeQuery()
2281  ->fetchOne();
2282  }
2283  return $isUserAllowedToLogin;
2284  }
2289  public function ‪logoff()
2290  {
2291  if (isset(‪$GLOBALS['BE_USER'])
2292  && ‪$GLOBALS['BE_USER'] instanceof self
2293  && isset(‪$GLOBALS['BE_USER']->user['uid'])
2294  ) {
2296  // Release the locked records
2297  $this->‪releaseLockedRecords((int)$GLOBALS['BE_USER']->user['uid']);
2298 
2299  if ($this->‪isSystemMaintainer()) {
2300  // If user is system maintainer, destroy its possibly valid install tool session.
2301  $session = new SessionService();
2302  $session->destroySession();
2303  }
2304  }
2305  parent::logoff();
2306  }
2307 
2312  protected function ‪releaseLockedRecords(int $userId)
2313  {
2314  if ($userId > 0) {
2315  GeneralUtility::makeInstance(ConnectionPool::class)
2316  ->getConnectionForTable('sys_lockedrecords')
2317  ->delete(
2318  'sys_lockedrecords',
2319  ['userid' => $userId]
2320  );
2321  }
2322  }
2323 
2331  public function ‪getOriginalUserIdWhenInSwitchUserMode(): ?int
2332  {
2333  $originalUserId = $this->‪getSessionData('backuserid');
2334  return $originalUserId ? (int)$originalUserId : null;
2335  }
2336 
2340  protected function ‪evaluateMfaRequirements(): void
2341  {
2342  // In case the current session is a "switch-user" session, MFA is not required
2343  if ($this->‪getOriginalUserIdWhenInSwitchUserMode() !== null) {
2344  $this->logger->debug('MFA is skipped in switch user mode', [
2345  $this->userid_column => $this->user[$this->userid_column],
2346  $this->username_column => $this->user[$this->username_column],
2347  ]);
2348  return;
2349  }
2350  parent::evaluateMfaRequirements();
2351  }
2352 
2359  public function ‪isMfaSetupRequired(): bool
2360  {
2361  $authConfig = $this->‪getTSConfig()['auth.']['mfa.'] ?? [];
2362 
2363  if (isset($authConfig['required'])) {
2364  // user TSconfig overrules global configuration
2365  return (bool)$authConfig['required'];
2366  }
2367 
2368  $globalConfig = (int)(‪$GLOBALS['TYPO3_CONF_VARS']['BE']['requireMfa'] ?? 0);
2369  if ($globalConfig <= 1) {
2370  // 0 and 1 can directly be used by type-casting to boolean
2371  return (bool)$globalConfig;
2372  }
2373 
2374  // check the system maintainer / admin / non-admin options
2375  $isAdmin = $this->‪isAdmin();
2376  return ($globalConfig === 2 && !$isAdmin)
2377  || ($globalConfig === 3 && $isAdmin)
2378  || ($globalConfig === 4 && $this->‪isSystemMaintainer());
2379  }
2380 
2386  public function ‪isImportEnabled(): bool
2387  {
2388  return $this->‪isAdmin()
2389  || ($this->‪getTSConfig()['options.']['impexp.']['enableImportForNonAdminUser'] ?? false);
2390  }
2391 
2397  public function ‪isExportEnabled(): bool
2398  {
2399  return $this->‪isAdmin()
2400  || ($this->‪getTSConfig()['options.']['impexp.']['enableExportForNonAdminUser'] ?? false);
2401  }
2402 
2408  public function ‪shallDisplayDebugInformation(): bool
2409  {
2410  return (‪$GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] ?? false) && $this->‪isAdmin();
2411  }
2412 }
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\returnWebmounts
‪array returnWebmounts()
Definition: BackendUserAuthentication.php:1012
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\evaluateUserSpecificFileFilterSettings
‪evaluateUserSpecificFileFilterSettings()
Definition: BackendUserAuthentication.php:1520
‪TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy
‪static array array[] parseOrderBy(string $input)
Definition: QueryHelper.php:44
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:999
‪TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction
Definition: HiddenRestriction.php:27
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspacePublishAccess
‪bool workspacePublishAccess($wsid)
Definition: BackendUserAuthentication.php:961
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\recordEditAccessInternals
‪bool recordEditAccessInternals($table, $idOrRow, $newRecord=false, $deletedRecord=false, $checkFullLanguageAccess=false)
Definition: BackendUserAuthentication.php:740
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get
‪static TYPO3 CMS Core FormProtection AbstractFormProtection get($classNameOrType='default',... $constructorArguments)
Definition: FormProtectionFactory.php:73
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$usergroup_table
‪string $usergroup_table
Definition: BackendUserAuthentication.php:73
‪TYPO3\CMS\Core\Database\Connection\PARAM_INT
‪const PARAM_INT
Definition: Connection.php:49
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:36
‪TYPO3\CMS\Core\Resource\ResourceStorage\getUid
‪int getUid()
Definition: ResourceStorage.php:330
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\setWebmounts
‪setWebmounts(array $mountPointUids, $append=false)
Definition: BackendUserAuthentication.php:1023
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getDefaultUploadFolder
‪TYPO3 CMS Core Resource Folder false getDefaultUploadFolder($pid=null, $table=null, $field=null)
Definition: BackendUserAuthentication.php:1655
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder\EQ
‪const EQ
Definition: ExpressionBuilder.php:37
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\writeUC
‪writeUC($variable='')
Definition: AbstractUserAuthentication.php:984
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\unpack_uc
‪unpack_uc($theUC='')
Definition: AbstractUserAuthentication.php:1012
‪TYPO3\CMS\Core\SysLog\Action
Definition: Cache.php:18
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$formfield_status
‪string $formfield_status
Definition: BackendUserAuthentication.php:182
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getPagePermsClause
‪string getPagePermsClause($perms)
Definition: BackendUserAuthentication.php:460
‪TYPO3\CMS\Core\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
Definition: TypoScriptParser.php:36
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\initializeDbMountpointsInWorkspace
‪initializeDbMountpointsInWorkspace()
Definition: BackendUserAuthentication.php:1765
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\initializeFileStorages
‪initializeFileStorages()
Definition: BackendUserAuthentication.php:1291
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$formfield_uname
‪string $formfield_uname
Definition: BackendUserAuthentication.php:172
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\calcPerms
‪int calcPerms($row)
Definition: BackendUserAuthentication.php:529
‪TYPO3\CMS\Core\Authentication
Definition: AbstractAuthenticationService.php:16
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\prepareUserTsConfig
‪prepareUserTsConfig()
Definition: BackendUserAuthentication.php:1249
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$usergroup_column
‪string $usergroup_column
Definition: BackendUserAuthentication.php:68
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getTSConfig
‪array getTSConfig()
Definition: BackendUserAuthentication.php:1000
‪TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
Definition: ConditionMatcher.php:31
‪TYPO3\CMS\Core\Type\Bitmask\Permission\NOTHING
‪const NOTHING
Definition: Permission.php:30
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$firstMainGroup
‪int $firstMainGroup
Definition: BackendUserAuthentication.php:197
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isAdmin
‪bool isAdmin()
Definition: BackendUserAuthentication.php:245
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$uc
‪array string $uc
Definition: BackendUserAuthentication.php:202
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$uc_default
‪array $uc_default
Definition: BackendUserAuthentication.php:213
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\check
‪bool check($type, $value)
Definition: BackendUserAuthentication.php:585
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isSystemMaintainer
‪bool isSystemMaintainer()
Definition: BackendUserAuthentication.php:417
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\fetchGroupData
‪fetchGroupData()
Definition: BackendUserAuthentication.php:1092
‪TYPO3\CMS\Core\Utility\StringUtility\uniqueList
‪static string uniqueList(string $list)
Definition: StringUtility.php:197
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getDefaultUploadTemporaryFolder
‪TYPO3 CMS Core Resource Folder null getDefaultUploadTemporaryFolder()
Definition: BackendUserAuthentication.php:1722
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\setDefaultWorkspace
‪setDefaultWorkspace()
Definition: BackendUserAuthentication.php:1961
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspaceCanCreateNewRecord
‪bool workspaceCanCreateNewRecord(string $table)
Definition: BackendUserAuthentication.php:880
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isMemberOfGroup
‪bool isMemberOfGroup($groupId)
Definition: BackendUserAuthentication.php:259
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkAuthMode
‪bool checkAuthMode($table, $field, $value, $authMode)
Definition: BackendUserAuthentication.php:600
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isMfaSetupRequired
‪bool isMfaSetupRequired()
Definition: BackendUserAuthentication.php:2332
‪$fields
‪$fields
Definition: pages.php:5
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$writeAttemptLog
‪bool $writeAttemptLog
Definition: BackendUserAuthentication.php:192
‪TYPO3\CMS\Core\Database\Connection\PARAM_STR
‪const PARAM_STR
Definition: Connection.php:54
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFileStorages
‪TYPO3 CMS Core Resource ResourceStorage[] getFileStorages()
Definition: BackendUserAuthentication.php:1506
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:26
‪TYPO3\CMS\Core\Core\Environment\getContext
‪static ApplicationContext getContext()
Definition: Environment.php:141
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$formfield_uident
‪string $formfield_uident
Definition: BackendUserAuthentication.php:177
‪TYPO3\CMS\Core\SysLog\Type\toChannel
‪static toChannel(int $type)
Definition: Type.php:76
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:43
‪TYPO3\CMS\Core\Type\Bitmask\BackendGroupMountOption
Definition: BackendGroupMountOption.php:27
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getCategoryMountPoints
‪array getCategoryMountPoints()
Definition: BackendUserAuthentication.php:1324
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFilePermissionsForStorage
‪array getFilePermissionsForStorage(ResourceStorage $storageObject)
Definition: BackendUserAuthentication.php:1621
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getCookieName
‪static string getCookieName()
Definition: BackendUserAuthentication.php:2088
‪TYPO3\CMS\Core\Type\Enumeration\cast
‪static static cast($value)
Definition: Enumeration.php:186
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFileMountRecords
‪array getFileMountRecords()
Definition: BackendUserAuthentication.php:1357
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\mayMakeShortcut
‪bool mayMakeShortcut()
Definition: BackendUserAuthentication.php:835
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\resetUC
‪resetUC()
Definition: BackendUserAuthentication.php:2216
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$userid_column
‪string $userid_column
Definition: BackendUserAuthentication.php:153
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$filePermissions
‪array null $filePermissions
Definition: BackendUserAuthentication.php:133
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$user_table
‪string $user_table
Definition: BackendUserAuthentication.php:138
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\initializeBackendLogin
‪initializeBackendLogin()
Definition: BackendUserAuthentication.php:2131
‪TYPO3\CMS\Core\Database\Query\QueryHelper
Definition: QueryHelper.php:32
‪TYPO3\CMS\Core\Type\Bitmask\Permission\ALL
‪const ALL
Definition: Permission.php:60
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\filterValidWebMounts
‪array filterValidWebMounts(string $listOfWebMounts)
Definition: BackendUserAuthentication.php:1210
‪TYPO3\CMS\Core\Database\Query\Restriction\RootLevelRestriction
Definition: RootLevelRestriction.php:27
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\evaluateMfaRequirements
‪evaluateMfaRequirements()
Definition: BackendUserAuthentication.php:2313
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\shallDisplayDebugInformation
‪shallDisplayDebugInformation()
Definition: BackendUserAuthentication.php:2381
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\setWorkspace
‪setWorkspace($workspaceId)
Definition: BackendUserAuthentication.php:1916
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getOriginalUserIdWhenInSwitchUserMode
‪int null getOriginalUserIdWhenInSwitchUserMode()
Definition: BackendUserAuthentication.php:2304
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$userTSUpdated
‪bool $userTSUpdated
Definition: BackendUserAuthentication.php:114
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\backendSetUC
‪backendSetUC()
Definition: BackendUserAuthentication.php:2162
‪TYPO3\CMS\Core\FormProtection\AbstractFormProtection\clean
‪clean()
Definition: AbstractFormProtection.php:56
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\ROLE_SYSTEMMAINTAINER
‪const ROLE_SYSTEMMAINTAINER
Definition: BackendUserAuthentication.php:63
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isUserAllowedToLogin
‪bool isUserAllowedToLogin()
Definition: BackendUserAuthentication.php:2235
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:37
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException
Definition: FolderDoesNotExistException.php:21
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\hasEditAccessToLiveWorkspace
‪hasEditAccessToLiveWorkspace()
Definition: BackendUserAuthentication.php:1889
‪TYPO3\CMS\Core\Resource\StorageRepository
Definition: StorageRepository.php:38
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$groupData
‪array $groupData
Definition: BackendUserAuthentication.php:79
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\doesUserHaveAccess
‪bool doesUserHaveAccess($row, $perms)
Definition: BackendUserAuthentication.php:283
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFilePermissions
‪array getFilePermissions()
Definition: BackendUserAuthentication.php:1563
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$username_column
‪string $username_column
Definition: BackendUserAuthentication.php:143
‪TYPO3\CMS\Core\SysLog\Error
Definition: Error.php:24
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getSessionData
‪mixed getSessionData($key)
Definition: AbstractUserAuthentication.php:1079
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:36
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser\checkIncludeLines_array
‪static array checkIncludeLines_array(array $array)
Definition: TypoScriptParser.php:1085
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkLanguageAccess
‪bool checkLanguageAccess($langValue)
Definition: BackendUserAuthentication.php:670
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:35
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter\setShowHiddenFilesAndFolders
‪static bool setShowHiddenFilesAndFolders($showHiddenFilesAndFolders)
Definition: FileNameFilter.php:71
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$checkWorkspaceCurrent_cache
‪array null $checkWorkspaceCurrent_cache
Definition: BackendUserAuthentication.php:125
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$userGroupsUID
‪array $userGroupsUID
Definition: BackendUserAuthentication.php:93
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\overrideUC
‪overrideUC()
Definition: BackendUserAuthentication.php:2206
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$enablecolumns
‪array $enablecolumns
Definition: BackendUserAuthentication.php:161
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$loginType
‪string $loginType
Definition: BackendUserAuthentication.php:228
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\logoff
‪logoff()
Definition: BackendUserAuthentication.php:2262
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\backendCheckLogin
‪backendCheckLogin($proceedIfNoUserIsLoggedIn=null)
Definition: BackendUserAuthentication.php:2107
‪TYPO3\CMS\Core\Http\RedirectResponse
Definition: RedirectResponse.php:28
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$user
‪array null $user
Definition: AbstractUserAuthentication.php:165
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\__construct
‪__construct()
Definition: BackendUserAuthentication.php:233
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\releaseLockedRecords
‪releaseLockedRecords(int $userId)
Definition: BackendUserAuthentication.php:2285
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:38
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$lastLogin_column
‪string $lastLogin_column
Definition: BackendUserAuthentication.php:157
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:125
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isRTE
‪bool isRTE()
Definition: BackendUserAuthentication.php:571
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:48
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\writelog
‪int writelog($type, $action, $error, $details_nr, $details, $data, $tablename='', $recuid='', $recpid='', $event_pid=-1, $NEWid='', $userId=0)
Definition: BackendUserAuthentication.php:2020
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$userTS
‪array $userTS
Definition: BackendUserAuthentication.php:110
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkWorkspace
‪array checkWorkspace($wsRec, $fields=' *')
Definition: BackendUserAuthentication.php:1822
‪TYPO3\CMS\Core\Type\Exception\InvalidEnumerationValueException
Definition: InvalidEnumerationValueException.php:23
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:28
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:43
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:927
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isExportEnabled
‪isExportEnabled()
Definition: BackendUserAuthentication.php:2370
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$workspace
‪int $workspace
Definition: BackendUserAuthentication.php:101
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspaceInit
‪workspaceInit()
Definition: BackendUserAuthentication.php:1750
‪TYPO3\CMS\Core\Resource\Filter\FileNameFilter
Definition: FileNameFilter.php:24
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkWorkspaceCurrent
‪array checkWorkspaceCurrent()
Definition: BackendUserAuthentication.php:1902
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\initializeWebmountsForElementBrowser
‪initializeWebmountsForElementBrowser()
Definition: BackendUserAuthentication.php:1046
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$userident_column
‪string $userident_column
Definition: BackendUserAuthentication.php:148
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isInWebMount
‪int null isInWebMount($idOrRow, $readPerms='', $exitOnError=null)
Definition: BackendUserAuthentication.php:304
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\setTemporaryWorkspace
‪bool setTemporaryWorkspace($workspaceId)
Definition: BackendUserAuthentication.php:1943
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Http\ImmediateResponseException
Definition: ImmediateResponseException.php:35
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$workspaceRec
‪array $workspaceRec
Definition: BackendUserAuthentication.php:106
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key)
Definition: ExtensionManagementUtility.php:114
‪TYPO3\CMS\Core\Type\Bitmask\JsConfirmation
Definition: JsConfirmation.php:25
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\checkFullLanguagesAccess
‪bool checkFullLanguagesAccess($table, $record)
Definition: BackendUserAuthentication.php:690
‪TYPO3\CMS\Core\Resource\Exception
Definition: AbstractFileOperationException.php:16
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspaceCheckStageForCurrent
‪bool workspaceCheckStageForCurrent($stage)
Definition: BackendUserAuthentication.php:899
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\isImportEnabled
‪isImportEnabled()
Definition: BackendUserAuthentication.php:2359
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$fileStorages
‪TYPO3 CMS Core Resource ResourceStorage[] $fileStorages
Definition: BackendUserAuthentication.php:129
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$writeStdLog
‪bool $writeStdLog
Definition: BackendUserAuthentication.php:187
‪TYPO3\CMS\Core\SysLog\Type\toLevel
‪static toLevel(int $type)
Definition: Type.php:81
‪TYPO3\CMS\Core\SysLog\Type
Definition: Type.php:28
‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication
Definition: AbstractUserAuthentication.php:56
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getDefaultWorkspace
‪int getDefaultWorkspace()
Definition: BackendUserAuthentication.php:1975
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\jsConfirmation
‪bool jsConfirmation($bitmask)
Definition: BackendUserAuthentication.php:1071
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\modAccess
‪bool modAccess($conf)
Definition: BackendUserAuthentication.php:375
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspaceAllowsLiveEditingInTable
‪bool workspaceAllowsLiveEditingInTable(string $table)
Definition: BackendUserAuthentication.php:850
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\$errorMsg
‪string $errorMsg
Definition: BackendUserAuthentication.php:120
‪TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction
Definition: WorkspaceRestriction.php:40