-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/trunk' into trunk
- Loading branch information
Showing
25 changed files
with
575 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
components/ILIAS/File/classes/Capabilities/CoreTypeResolver.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\File\Capabilities; | ||
|
||
/** | ||
* @author Fabian Schmid <[email protected]> | ||
*/ | ||
class CoreTypeResolver implements TypeResolver | ||
{ | ||
public function resolveType(int $ref_id): string | ||
{ | ||
return \ilObject2::_lookupType($ref_id, true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
components/ILIAS/File/classes/Capabilities/TypeResolver.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\File\Capabilities; | ||
|
||
/** | ||
* @author Fabian Schmid <[email protected]> | ||
*/ | ||
interface TypeResolver | ||
{ | ||
public function resolveType(int $ref_id): string; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
use ILIAS\File\Capabilities\CapabilityBuilder; | ||
use ILIAS\components\WOPI\Discovery\ActionDBRepository; | ||
use ILIAS\File\Capabilities\Capabilities; | ||
use ILIAS\File\Capabilities\CoreTypeResolver; | ||
|
||
/** | ||
* @author Fabian Schmid <[email protected]> | ||
|
@@ -47,6 +48,7 @@ public function __construct() | |
$DIC->ctrl(), | ||
new ActionDBRepository($DIC->database()), | ||
$DIC->http(), | ||
new CoreTypeResolver(), | ||
$DIC['static_url.uri_builder'] | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
File Object | ||
=========== | ||
|
||
# General Information | ||
|
||
The file object is the files that were created in the magazine via ‘Add new | ||
Object’. The file object uses many of the central file services and also offers | ||
WOPI actions, for example. | ||
|
||
# Capabilities | ||
|
||
The file object uses an internal mechanism to handle all the ‘functions’ that a | ||
user with a file object can perform. The capabilities currently check | ||
authorisations, whether WOPI actions are available for a file and also certain | ||
settings per object. The capabilities per user and file object are calculated | ||
once per request and are then used to provide links to actions, create tabs and | ||
also handle static URLs, for example. In particular, the capabilities are also | ||
used to decide which action to open by default when clicking on a file object in | ||
the magazine. | ||
Here is a list (based on unit tests) of cases in which a default action is to be | ||
expected: | ||
|
||
<!-- START CAPABILITY_TABLE --> | ||
|
||
| User's Permissions | WOPI View Action av. | WOPI Edit Action av. | Click-Setting | Expected Capability | | ||
| --------------------------------------------- | -------------------- | -------------------- | ------------- | ------------------- | | ||
| read | Yes | Yes | Open | DOWNLOAD | | ||
| write, read | Yes | Yes | Open | DOWNLOAD | | ||
| edit_file | Yes | Yes | Open | EDIT_EXTERNAL | | ||
| read, visible | No | No | Info-Page | FORCED_INFO_PAGE | | ||
| read, write, visible, edit_file, view_content | Yes | Yes | Info-Page | FORCED_INFO_PAGE | | ||
| write, read | Yes | Yes | Info-Page | FORCED_INFO_PAGE | | ||
| visible | Yes | Yes | Open | INFO_PAGE | | ||
| write | Yes | Yes | Open | MANAGE_VERSIONS | | ||
| none | Yes | Yes | Open | NONE | | ||
| edit_file, view_content | Yes | Yes | Open | VIEW_EXTERNAL | | ||
| read, write, visible, edit_file, view_content | Yes | Yes | Open | VIEW_EXTERNAL | | ||
|
||
<!-- END CAPABILITY_TABLE --> |
Oops, something went wrong.