ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Manage.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
30 class Manage extends BaseCheck implements Check
31 {
32  public function canUnlock(): Capabilities
33  {
34  return Capabilities::MANAGE_VERSIONS;
35  }
36 
37  public function maybeUnlock(
38  Capability $capability,
39  CheckHelpers $helpers,
40  \ilObjFileInfo $info,
42  ): Capability {
43  return $capability->withUnlocked($this->hasPermission($helpers, $context, ...$capability->getPermissions()));
44  }
45 
46  public function maybeBuildURI(Capability $capability, CheckHelpers $helpers, Context $context): Capability
47  {
48  if (!$capability->isUnlocked()) {
49  return $capability;
50  }
51  return $capability->withURI(
52  $helpers->fromTarget(
53  $helpers->ctrl->getLinkTargetByClass([
54  $this->baseClass($context),
55  \ilObjFileGUI::class,
56  \ilFileVersionsGUI::class
57  ])
58  )
59  );
60  }
61 
62 }
$context
Definition: webdav.php:31
hasPermission(CheckHelpers $helpers, Context $context, Permissions ... $permission)
Definition: BaseCheck.php:36
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: BaseCheck.php:21
maybeUnlock(Capability $capability, CheckHelpers $helpers, \ilObjFileInfo $info, Context $context,)
Definition: Manage.php:37
maybeBuildURI(Capability $capability, CheckHelpers $helpers, Context $context)
Definition: Manage.php:46