Merge branch 'sprint/167_tianshujie_15541' into 'sprint/167'
*Fix bug #15541. See merge request easycorp/zentaopms!74
This commit is contained in:
@@ -435,6 +435,21 @@ class groupModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Update whitelist. */
|
||||
$acl = $this->dao->select('acl')->from(TABLE_GROUP)->where('id')->eq($groupID)->fetch('acl');
|
||||
$acl = json_decode($acl);
|
||||
|
||||
$this->loadModel('personnel');
|
||||
foreach($this->config->group->acl->objectTypes as $key => $objectType)
|
||||
{
|
||||
if(!isset($acl->{$key})) continue;
|
||||
foreach($acl->{$key} as $objectID)
|
||||
{
|
||||
$this->personnel->updateWhitelist($newUsers, $objectType, $objectID, 'whitelist', 'sync', 'increase');
|
||||
$this->personnel->deleteWhitelist($delUsers, $objectType, $objectID);
|
||||
}
|
||||
}
|
||||
|
||||
/* Adjust user view. */
|
||||
$changedUsers = array_merge($newUsers, $delUsers);
|
||||
if(!empty($changedUsers))
|
||||
|
||||
@@ -622,10 +622,13 @@ class personnelModel extends model
|
||||
$product = $this->loadModel('product')->getById($objectID);
|
||||
if(empty($product)) return false;
|
||||
|
||||
$programWhitelist = $this->getWhitelistAccount($product->program, 'program');
|
||||
$newWhitelist = array_merge($programWhitelist, $accounts);
|
||||
$source = $source == 'upgrade' ? 'upgrade' : 'sync';
|
||||
$this->updateWhitelist($newWhitelist, 'program', $product->program, 'whitelist', $source, $updateType);
|
||||
if($this->config->systemMode == 'new')
|
||||
{
|
||||
$programWhitelist = $this->getWhitelistAccount($product->program, 'program');
|
||||
$newWhitelist = array_merge($programWhitelist, $accounts);
|
||||
$source = $source == 'upgrade' ? 'upgrade' : 'sync';
|
||||
$this->updateWhitelist($newWhitelist, 'program', $product->program, 'whitelist', $source, $updateType);
|
||||
}
|
||||
|
||||
/* Removal of persons from centralized program whitelisting. */
|
||||
if($updateType == 'replace')
|
||||
@@ -640,10 +643,13 @@ class personnelModel extends model
|
||||
$sprint = $this->dao->select('id,project')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch();
|
||||
if(empty($sprint)) return false;
|
||||
|
||||
$projectWhitelist = $this->getWhitelistAccount($sprint->project, 'project');
|
||||
$newWhitelist = array_merge($projectWhitelist, $accounts);
|
||||
$source = $source == 'upgrade' ? 'upgrade' : 'sync';
|
||||
$this->updateWhitelist($newWhitelist, 'project', $sprint->project, 'whitelist', $source, $updateType);
|
||||
if($this->config->systemMode == 'new')
|
||||
{
|
||||
$projectWhitelist = $this->getWhitelistAccount($sprint->project, 'project');
|
||||
$newWhitelist = array_merge($projectWhitelist, $accounts);
|
||||
$source = $source == 'upgrade' ? 'upgrade' : 'sync';
|
||||
$this->updateWhitelist($newWhitelist, 'project', $sprint->project, 'whitelist', $source, $updateType);
|
||||
}
|
||||
|
||||
/* Removal of whitelisted persons from projects. */
|
||||
if($updateType == 'replace')
|
||||
|
||||
Reference in New Issue
Block a user