* Adjustment Code.

This commit is contained in:
leiyong
2020-10-20 17:27:04 +08:00
parent 376e1c7d6e
commit efd978eb95
18 changed files with 152 additions and 217 deletions
+36
View File
@@ -204,6 +204,42 @@ class groupModel extends model
->fetchPairs();
}
/**
* Get the ID of the group that has access to the program.
*
* @access public
* @return array
*/
public function getAccessProgramGroup()
{
$accessibleGroup = $this->getList();
$accessibleGroupID = array(0);
foreach($accessibleGroup as $group)
{
if($group->acl) $group->acl = json_decode($group->acl, true);
if(!isset($group->acl) || !is_array($group->acl)) $group->acl = array();
if(empty($group->acl))
{
$accessibleGroupID[] = $group->id;
continue;
}
if(!isset($group->acl['views']) || empty($group->acl['views']))
{
$accessibleGroupID[] = $group->id;
continue;
}
if(in_array('program', $group->acl['views']))
{
$accessibleGroupID[] = $group->id;
continue;
}
}
return $accessibleGroupID;
}
/**
* Delete a group.
*