Skip to content
Snippets Groups Projects
Verified Commit d9f84dbb authored by Jerome Boucher's avatar Jerome Boucher
Browse files

FIX #25236 TIME 02:00 compatibility for openssl 3

parent 2f69c225
No related branches found
No related tags found
2 merge requests!838Rebase develop,!837V3.0
......@@ -213,7 +213,7 @@ class serviceAccount
$account = $this->read($accountToken->accountId);
if ($this->hasSecurityLevel) {
if (array_search($serviceAccount->accountName, array_column($this->search(), 'accountName')) === false){
if (array_search($serviceAccount->accountName, array_column($this->search(), 'accountName')) === false) {
throw new \core\Exception\UnauthorizedException("You are not allowed to modify this service account");
}
$this->checkPrivilegesAccess($account, $serviceAccount);
......@@ -249,14 +249,23 @@ class serviceAccount
}
if ($this->hasSecurityLevel) {
if ($account->getSecurityLevel() == $account::SECLEVEL_FUNCADMIN && array_search($account->ownerOrgId, array_column($this->organizationController->readParentOrg($orgId), 'orgId')) === false){
if (
$account->getSecurityLevel() == $account::SECLEVEL_FUNCADMIN
&& array_search(
$account->ownerOrgId,
array_column($this->organizationController->readParentOrg($orgId), 'orgId')
) === false
) {
throw new \core\Exception\ForbiddenException("You are not allowed to add user in this organization");
}
$this->checkPrivilegesAccess($account, $serviceAccount);
}
if (!$serviceAccount->ownerOrgId && !empty($orgId)) {
if(!empty($serviceAccount->ownerOrgId) && $serviceAccount->ownerOrgId != $organization->ownerOrgId) {
if (
!empty($serviceAccount->ownerOrgId)
&& $serviceAccount->ownerOrgId != $organization->ownerOrgId
) {
throw new \core\Exception\NotFoundException("Organization identified by " . $serviceAccount->ownerOrgId . " is not the owner organization of the organization identified by " . $orgId);
}
$serviceAccount->ownerOrgId = $organization->ownerOrgId;
......@@ -366,14 +375,15 @@ class serviceAccount
$organizationController = \laabs::newController("organization/organization");
$accountToken = \laabs::getToken('AUTH');
$account = $this->read($accountToken->accountId);
$serviceAccount = $this->read($serviceAccount->accountId);
if ($account->accountId != $serviceAccount->accountId && $this->hasSecurityLevel) {
if ($account->getSecurityLevel() == $account::SECLEVEL_GENADMIN) {
if (!$serviceAccount->isAdmin) {
throw new \core\Exception\UnauthorizedException("You are not allowed to modify this service account");
}
}
else if ($account->getSecurityLevel() == $account::SECLEVEL_FUNCADMIN) {
} elseif (
$account->getSecurityLevel() == $account::SECLEVEL_FUNCADMIN
) {
$organization = $this->sdoFactory->read('organization/organization', $account->ownerOrgId);
$organizations = $this->organizationController->readDescendantOrg($organization->orgId);
$organizations[] = $organization;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment