-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLAT-24956+PLAT-24957: Add support for configuring support access mode + block login when support access not allowed #12902
Open
yossipapi
wants to merge
4
commits into
Ursa-21.2.0
Choose a base branch
from
Tucana-20.20.0-PLAT-24956
base: Ursa-21.2.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1acdeb9
PLAT-24956+PLAT-24957: Add support for configuring support access mod…
yossipapi 2a5ced1
Merge branch 'Ursa-21.0.0' of https://github.com/kaltura/server into …
yossipapi 79d62d2
PLAT-24956: Enforce who can update support access fields + add missin…
yossipapi 63a011b
Merge branch 'Ursa-21.2.0' of https://github.com/kaltura/server into …
yossipapi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* @package Core | ||
* @subpackage model.enum | ||
*/ | ||
interface SupportAccessMode extends BaseEnum | ||
{ | ||
//Access to manage the account is always allowed | ||
const ALLWAYS_ALLOWED = 0; | ||
|
||
//Access will be blocked unless security team opens overrides this in case of security/production incidents | ||
const NEVER_ALLOWED = 1; | ||
|
||
//Access to manage the account will be opened and the time frame of it will controlled by the account admins | ||
const USER_CONTROLLED = 2; | ||
|
||
|
||
} |
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 |
---|---|---|
|
@@ -523,6 +523,10 @@ class KalturaErrors extends APIErrors | |
const PROPERTY_IS_NOT_DEFINED = "PROPERTY_IS_NOT_DEFINED;PROP,TYPE;The property \"@PROP@\" is not defined on type \"@TYPE@\""; | ||
|
||
const GROUPS_CANNOT_CO_EXIST = "GROUPS_CANNOT_CO_EXIST;userId,group,blockedCoExist;Cannot add user [@userId@] to group [@group@], User is already member of a group with coexistence enforcement [@blockedCoExist@]"; | ||
|
||
const CAN_ONLY_BE_UPDATED_BY_ACCOUNT_OWNER = "CAN_ONLY_BE_CHANGED_BY_ACCOUNT_OWNER;;Support access mode can only be updated by the account owner"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would chose either changed/updated and use one terminology for all |
||
|
||
const SUPPORT_ACCESS_CANNOT_BE_ENABLED = "SUPPORT_ACCESS_CANNOT_BE_ENABLED;;Support access cannot be enabled, please contact you account admin to change support access mode to be set to user_controlled"; | ||
|
||
/* | ||
* syndication service | ||
|
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,9 @@ | ||
<?php | ||
/** | ||
* @package api | ||
* @subpackage enum | ||
*/ | ||
class KalturaSupportAccessMode extends KalturaEnum implements SupportAccessMode | ||
{ | ||
|
||
} |
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 |
---|---|---|
|
@@ -210,6 +210,10 @@ public function getAdminSessionAction($pId, $userId = null) | |
$userId = $dbPartner->getAdminUserId(); | ||
} | ||
|
||
if(!$dbPartner->isSupportAccessAllowed()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. { in new line |
||
throw new KalturaAPIException(KalturaErrors::PARTNER_LOGIN_FORBIDDEN, kCurrentContext::getCurrentPartnerId(), $pId); | ||
} | ||
|
||
$kuser = kuserPeer::getKuserByPartnerAndUid($pId, $userId); | ||
if (!$kuser) { | ||
throw new KalturaAPIException(KalturaErrors::INVALID_USER_ID, $userId); | ||
|
@@ -219,7 +223,7 @@ public function getAdminSessionAction($pId, $userId = null) | |
} | ||
|
||
$ks = ""; | ||
kSessionUtils::createKSessionNoValidations($dbPartner->getId(), $userId, $ks, 86400, 2, "", '*,' . ks::PRIVILEGE_DISABLE_ENTITLEMENT); | ||
kSessionUtils::createKSessionNoValidations($dbPartner->getId(), $userId, $ks, $dbPartner->getSupportAccessMaxKsExpiry(), 2, "", '*,' . ks::PRIVILEGE_DISABLE_ENTITLEMENT); | ||
return $ks; | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the case you set allowedUntil= time() - 3600 this condition in line 2466 will always be false, is this intended?