ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\FileUpload\Activities\AccessCheck Class Reference

The permission rule the file activities share: a file may only be handled by a user the system knows, never by the anonymous user. More...

+ Collaboration diagram for ILIAS\FileUpload\Activities\AccessCheck:

Static Public Member Functions

static isKnownUser (int $usr_id)
 

Detailed Description

The permission rule the file activities share: a file may only be handled by a user the system knows, never by the anonymous user.

This is the whole authorisation of the low level activities on purpose - they work on temporary files that only their own handles address. Activities that touch real objects have to check RBAC.

Definition at line 31 of file AccessCheck.php.

Member Function Documentation

◆ isKnownUser()

static ILIAS\FileUpload\Activities\AccessCheck::isKnownUser ( int  $usr_id)
static

Definition at line 33 of file AccessCheck.php.

33 : bool
34 {
35 if ($usr_id <= 0) {
36 return false;
37 }
38
39 // without the id of the anonymous user there is no telling it apart, and a
40 // check that lacks what it needs refuses rather than lets through
41 if (!defined('ANONYMOUS_USER_ID')) {
42 return false;
43 }
44
45 return $usr_id !== (int) ANONYMOUS_USER_ID;
46 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ANONYMOUS_USER_ID, and ILIAS\Repository\int().

Referenced by ILIAS\File\Activities\CopyFile\isAllowedToPerform(), ILIAS\File\Activities\CreateFile\isAllowedToPerform(), ILIAS\File\Activities\DeleteFile\isAllowedToPerform(), ILIAS\File\Activities\DeliverFileObject\isAllowedToPerform(), ILIAS\File\Activities\DeliverFileVersion\isAllowedToPerform(), ILIAS\File\Activities\ListContainerContent\isAllowedToPerform(), ILIAS\File\Activities\ListFileVersions\isAllowedToPerform(), ILIAS\File\Activities\MoveFile\isAllowedToPerform(), ILIAS\File\Activities\ReplaceFileContent\isAllowedToPerform(), ILIAS\File\Activities\UpdateFileMetadata\isAllowedToPerform(), ILIAS\ResourceStorage\Activities\DeliverResource\isAllowedToPerform(), ILIAS\FileUpload\Activities\AccessCheckTest\testAUserOfTheSystemIsKnown(), ILIAS\FileUpload\Activities\AccessCheckTest\testNeitherNobodyNorTheAnonymousUserIsKnown(), and ILIAS\FileUpload\Activities\AccessCheckTest\testWithoutTheAnonymousUserNobodyIsKnown().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: