Skip to content

Commit

Permalink
cherry pick ILIAS-eLearning#3768
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansenDatabay authored and mstuder committed Mar 10, 2022
1 parent e43c8ad commit 7c645cb
Showing 1 changed file with 34 additions and 21 deletions.
55 changes: 34 additions & 21 deletions Services/MyStaff/classes/class.ilMyStaffCachedAccessDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(Container $dic, ilMyStaffAccess $origin)
$this->origin = $origin;
}

final public function hasCurrentUserAccessToMyStaff() : bool
public function hasCurrentUserAccessToMyStaff() : bool
{
static $cache = null;

Expand All @@ -46,7 +46,7 @@ final public function hasCurrentUserAccessToMyStaff() : bool
return $cache;
}

final public function hasCurrentUserAccessToCertificates() : bool
public function hasCurrentUserAccessToCertificates() : bool
{
static $cache = null;

Expand All @@ -57,7 +57,7 @@ final public function hasCurrentUserAccessToCertificates() : bool
return $cache;
}

final public function hasCurrentUserAccessToCompetences() : bool
public function hasCurrentUserAccessToCompetences() : bool
{
static $cache = null;

Expand All @@ -68,7 +68,7 @@ final public function hasCurrentUserAccessToCompetences() : bool
return $cache;
}

final public function hasCurrentUserAccessToUser($usr_id = 0) : bool
public function hasCurrentUserAccessToUser($usr_id = 0) : bool
{
static $cache = [];

Expand All @@ -79,7 +79,7 @@ final public function hasCurrentUserAccessToUser($usr_id = 0) : bool
return $cache[$usr_id];
}

final public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bool
public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bool
{
static $cache = [];

Expand All @@ -90,7 +90,7 @@ final public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0
return $cache[$ref_id];
}

final public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() : bool
public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() : bool
{
static $cache = null;

Expand Down Expand Up @@ -121,12 +121,12 @@ public function hasPositionDefaultPermissionForOperationInContext(
return $cache[$cache_key];
}

final public function countOrgusOfUserWithAtLeastOneOperation($user_id) : int
public function countOrgusOfUserWithAtLeastOneOperation($user_id) : int
{
return $this->origin->countOrgusOfUserWithAtLeastOneOperation($user_id);
}

final public function countOrgusOfUserWithOperationAndContext(
public function countOrgusOfUserWithOperationAndContext(
$user_id,
$org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT
Expand All @@ -138,7 +138,8 @@ final public function countOrgusOfUserWithOperationAndContext(
);
}

final public function getUsersForUserOperationAndContext(

public function getUsersForUserOperationAndContext(
$user_id,
$org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT,
Expand All @@ -152,17 +153,20 @@ final public function getUsersForUserOperationAndContext(
);
}

final public function getUsersForUserPerPosition($user_id) : array

public function getUsersForUserPerPosition($user_id) : array
{
return $this->origin->getUsersForUserPerPosition($user_id);
}

final public function getUsersForUser($user_id, ?int $position_id = null) : array

public function getUsersForUser($user_id, ?int $position_id = null) : array
{
return $this->origin->getUsersForUser($user_id, $position_id);
}

final public function getIdsForUserAndOperation(int $user_id, string $operation, bool $return_ref_id = false) : array

public function getIdsForUserAndOperation(int $user_id, string $operation, bool $return_ref_id = false) : array
{
return $this->origin->getIdsForUserAndOperation(
$user_id,
Expand All @@ -171,7 +175,8 @@ final public function getIdsForUserAndOperation(int $user_id, string $operation,
);
}

final public function getIdsForPositionAndOperation(int $position_id, string $operation, bool $return_ref_id) : array

public function getIdsForPositionAndOperation(int $position_id, string $operation, bool $return_ref_id) : array
{
return $this->origin->getIdsForPositionAndOperation(
$position_id,
Expand All @@ -180,7 +185,8 @@ final public function getIdsForPositionAndOperation(int $position_id, string $op
);
}

final public function getIdsForPositionAndOperationAndContext(

public function getIdsForPositionAndOperationAndContext(
int $position_id,
string $operation,
string $context,
Expand All @@ -194,7 +200,8 @@ final public function getIdsForPositionAndOperationAndContext(
);
}

final public function getIlobjectsAndUsersForUserOperationAndContext(

public function getIlobjectsAndUsersForUserOperationAndContext(
$user_id,
$org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT
Expand All @@ -206,7 +213,8 @@ final public function getIlobjectsAndUsersForUserOperationAndContext(
);
}

final public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext(

public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext(
$user_id,
$org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT,
Expand All @@ -220,7 +228,8 @@ final public function buildTempTableIlobjectsUserMatrixForUserOperationAndConte
);
}

final public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext(

public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext(
$org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT,
$temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS
Expand All @@ -232,7 +241,8 @@ final public function buildTempTableIlobjectsSpecificPermissionSetForOperationA
);
}

final public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext(

public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext(
$org_unit_operation_string = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS,
$context = self::DEFAULT_CONTEXT,
$temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS
Expand All @@ -244,7 +254,8 @@ final public function buildTempTableIlobjectsDefaultPermissionSetForOperationAn
);
}

final public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext(

public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext(
$org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION,
$context = self::DEFAULT_CONTEXT,
$temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS
Expand All @@ -256,7 +267,8 @@ final public function buildTempTableIlorgunitDefaultPermissionSetForOperationAn
);
}

final public function buildTempTableCourseMemberships(

public function buildTempTableCourseMemberships(
$temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS,
array $only_courses_of_user_ids = []
) : string {
Expand All @@ -276,7 +288,8 @@ public function buildTempTableOrguMemberships(
);
}

final public function dropTempTable($temporary_table_name) : void

public function dropTempTable($temporary_table_name) : void
{
$this->origin->dropTempTable($temporary_table_name);
}
Expand Down

0 comments on commit 7c645cb

Please sign in to comment.