* fix for block by priv.

This commit is contained in:
wangyidong
2018-10-23 16:30:55 +08:00
parent d64306aa90
commit 63a1a2601d
2 changed files with 7 additions and 7 deletions
+7
View File
@@ -216,9 +216,16 @@ class block extends control
if($this->block->initBlock($module)) die(js::reload());
}
$acls = $this->app->user->rights['acls'];
$shortBlocks = $longBlocks = array();
foreach($blocks as $key => $block)
{
if(!empty($block->source) and !empty($acls['views']) and !isset($acls['views'][$block->source]))
{
unset($blocks[$key]);
continue;
}
if($this->config->global->flow == 'onlyStory' and $block->source != 'product' and $block->source != 'todo' and $block->block != 'dynamic') unset($blocks[$key]);
if($this->config->global->flow == 'onlyTask' and $block->source != 'project' and $block->source != 'todo' and $block->block != 'dynamic') unset($blocks[$key]);
if($this->config->global->flow == 'onlyTest' and $block->source != 'qa' and $block->source != 'todo' and $block->block != 'dynamic') unset($blocks[$key]);
-7
View File
@@ -207,7 +207,6 @@ class blockModel extends model
{
$flow = isset($this->config->global->flow) ? $this->config->global->flow : 'full';
$blocks = $module == 'my' ? $this->lang->block->default[$flow][$module] : $this->lang->block->default[$module];
$acls = $this->app->user->rights['acls'];
$account = $this->app->user->account;
/* Mark this app has init. */
@@ -215,12 +214,6 @@ class blockModel extends model
$this->loadModel('setting')->setItem("$account.$module.block.initVersion", $this->config->block->version);
foreach($blocks as $index => $block)
{
if(!empty($block['source']) and !empty($acls) and !isset($acls['views'][$block['source']]))
{
unset($blocks[$index]);
continue;
}
$block['order'] = $index;
$block['module'] = $module;
$block['account'] = $account;