mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Merge remote-tracking branch 'origin/support/3.2' into develop
# Conflicts: # core/attributedef.class.inc.php # setup/extensionsmap.class.inc.php # tests/php-unit-tests/composer.lock
This commit is contained in:
@@ -1928,6 +1928,17 @@ EOF
|
||||
$sObjClass = utils::ReadParam('obj_class', '', false, 'class');
|
||||
$iObjKey = (int)utils::ReadParam('obj_key', 0, false, 'integer');
|
||||
|
||||
// Check user has access to the object before trying to acquire the lock
|
||||
$oSearch = new DBObjectSearch($sObjClass);
|
||||
$oSearch->AddCondition(MetaModel::DBGetKey($sObjClass), $iObjKey, '=');
|
||||
$oSet = new CMDBObjectSet($oSearch);
|
||||
if (
|
||||
false === $oSet->CountExceeds(0) ||
|
||||
UserRights::IsActionAllowed($sObjClass, UR_ACTION_MODIFY, $oSet) !== UR_ALLOWED_YES
|
||||
) {
|
||||
throw new SecurityException(Dict::S('UI:ObjectDoesNotExist'));
|
||||
}
|
||||
|
||||
$aResult = iTopOwnershipLock::AcquireLock($sObjClass, $iObjKey);
|
||||
if (false === $aResult['success']) {
|
||||
$aLockData = iTopOwnershipLock::IsLocked($sObjClass, $iObjKey);
|
||||
|
||||
Reference in New Issue
Block a user