TYPO3  7.6
extbase/Classes/Domain/Model/BackendUserGroup.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extbase\Domain\Model;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
23 {
24  const FILE_OPPERATIONS = 1;
25  const FILE_UNZIP = 2;
27  const DIRECTORY_COPY = 8;
29 
34  protected $title = '';
35 
39  protected $description = '';
40 
44  protected $subGroups;
45 
49  protected $modules = '';
50 
54  protected $tablesListening = '';
55 
59  protected $tablesModify = '';
60 
64  protected $pageTypes = '';
65 
69  protected $allowedExcludeFields = '';
70 
74  protected $explicitlyAllowAndDeny = '';
75 
79  protected $allowedLanguages = '';
80 
84  protected $workspacePermission = false;
85 
89  protected $databaseMounts = '';
90 
95 
99  protected $lockToDomain = '';
100 
104  protected $hideInList = false;
105 
109  protected $tsConfig = '';
110 
114  public function __construct()
115  {
116  $this->subGroups = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
117  }
118 
125  public function setTitle($title)
126  {
127  $this->title = $title;
128  }
129 
135  public function getTitle()
136  {
137  return $this->title;
138  }
139 
146  public function setDescription($description)
147  {
148  $this->description = $description;
149  }
150 
156  public function getDescription()
157  {
158  return $this->description;
159  }
160 
167  public function setSubGroups(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $subGroups)
168  {
169  $this->subGroups = $subGroups;
170  }
171 
178  public function addSubGroup(\TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup $beGroup)
179  {
180  $this->subGroups->attach($beGroup);
181  }
182 
189  public function removeSubGroup(\TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup $groupToDelete)
190  {
191  $this->subGroups->detach($groupToDelete);
192  }
193 
199  public function removeAllSubGroups()
200  {
202  $this->subGroups->removeAll($subGroups);
203  }
204 
210  public function getSubGroups()
211  {
212  return $this->subGroups;
213  }
214 
221  public function setModules($modules)
222  {
223  $this->modules = $modules;
224  }
225 
231  public function getModules()
232  {
233  return $this->modules;
234  }
235 
243  {
244  $this->tablesListening = $tablesListening;
245  }
246 
252  public function getTablesListening()
253  {
254  return $this->tablesListening;
255  }
256 
264  {
265  $this->tablesModify = $tablesModify;
266  }
267 
273  public function getTablesModify()
274  {
275  return $this->tablesModify;
276  }
277 
284  public function setPageTypes($pageTypes)
285  {
286  $this->pageTypes = $pageTypes;
287  }
288 
294  public function getPageTypes()
295  {
296  return $this->pageTypes;
297  }
298 
306  {
307  $this->allowedExcludeFields = $allowedExcludeFields;
308  }
309 
315  public function getAllowedExcludeFields()
316  {
318  }
319 
327  {
328  $this->explicitlyAllowAndDeny = $explicitlyAllowAndDeny;
329  }
330 
336  public function getExplicitlyAllowAndDeny()
337  {
339  }
340 
348  {
349  $this->allowedLanguages = $allowedLanguages;
350  }
351 
357  public function getAllowedLanguages()
358  {
360  }
361 
369  {
370  $this->workspacePermission = $workspacePermission;
371  }
372 
378  public function getWorkspacePermission()
379  {
381  }
382 
390  {
391  $this->databaseMounts = $databaseMounts;
392  }
393 
399  public function getDatabaseMounts()
400  {
401  return $this->databaseMounts;
402  }
403 
411  {
412  $this->fileOperationPermissions = $fileOperationPermissions;
413  }
414 
420  public function getFileOperationPermissions()
421  {
423  }
424 
431  public function isFileOperationAllowed()
432  {
433  return $this->isPermissionSet(self::FILE_OPPERATIONS);
434  }
435 
442  public function setFileOperationAllowed($value)
443  {
444  $this->setPermission(self::FILE_OPPERATIONS, $value);
445  }
446 
452  public function isFileUnzipAllowed()
453  {
454  return $this->isPermissionSet(self::FILE_UNZIP);
455  }
456 
463  public function setFileUnzipAllowed($value)
464  {
465  $this->setPermission(self::FILE_UNZIP, $value);
466  }
467 
473  public function isDirectoryOperationAllowed()
474  {
475  return $this->isPermissionSet(self::DIRECTORY_OPPERATIONS);
476  }
477 
484  public function setDirectoryOperationAllowed($value)
485  {
486  $this->setPermission(self::DIRECTORY_OPPERATIONS, $value);
487  }
488 
494  public function isDirectoryCopyAllowed()
495  {
496  return $this->isPermissionSet(self::DIRECTORY_COPY);
497  }
498 
505  public function setDirectoryCopyAllowed($value)
506  {
507  $this->setPermission(self::DIRECTORY_COPY, $value);
508  }
509 
516  {
517  return $this->isPermissionSet(self::DIRECTORY_REMOVE_RECURSIVELY);
518  }
519 
526  public function setDirectoryRemoveRecursivelyAllowed($value)
527  {
528  $this->setPermission(self::DIRECTORY_REMOVE_RECURSIVELY, $value);
529  }
530 
538  {
539  $this->lockToDomain = $lockToDomain;
540  }
541 
547  public function getLockToDomain()
548  {
549  return $this->lockToDomain;
550  }
551 
558  public function setHideInList($hideInList)
559  {
560  $this->hideInList = $hideInList;
561  }
562 
568  public function getHideInList()
569  {
570  return $this->hideInList;
571  }
572 
578  public function setTsConfig($tsConfig)
579  {
580  $this->tsConfig = $tsConfig;
581  }
582 
588  public function getTsConfig()
589  {
590  return $this->tsConfig;
591  }
592 
599  protected function isPermissionSet($permission)
600  {
601  return ($this->fileOperationPermissions & $permission) == $permission;
602  }
603 
611  protected function setPermission($permission, $value)
612  {
613  if ($value) {
614  $this->fileOperationPermissions |= $permission;
615  } else {
616  $this->fileOperationPermissions &= ~$permission;
617  }
618  }
619 }