修复超级管理员无法在列表查看超级管理员的BUG

pull/28/head
Karson 2017-12-06 17:50:23 +08:00
parent 0c953105c8
commit 0ac468d85c
1 changed files with 16 additions and 8 deletions

View File

@ -289,8 +289,10 @@ class Auth extends \fast\Auth
*/
public function getChildrenAdminIds($withself = false)
{
$groupIds = $this->getChildrenGroupIds(false);
$childrenAdminIds = [];
if (!$this->isSuperAdmin())
{
$groupIds = $this->getChildrenGroupIds(false);
$authGroupList = model('AuthGroupAccess')
->field('uid,group_id')
->where('group_id', 'in', $groupIds)
@ -300,6 +302,12 @@ class Auth extends \fast\Auth
{
$childrenAdminIds[] = $v['uid'];
}
}
else
{
//超级管理员拥有所有人的权限
$childrenAdminIds = Admin::column('id');
}
if ($withself)
{
if (!in_array($this->id, $childrenAdminIds))