public function addNamedGroupingPolicy($ptype, ...$params)
    {
        $ruleAdded = false;
        if (1 == count($params) && is_array($params[0])) {
            $strSlice = $params[0];
            $ruleAdded = $this->addPolicyInternal('g', $ptype, $strSlice);
        } else {
            $policy = [];
            foreach ($params as $param) {
                $policy[] = $param;
            }

            $ruleAdded = $this->addPolicyInternal('g', $ptype, $policy);
        }

        if ($this->autoBuildRoleLinks) {
            $this->buildRoleLinks();
        }

        return $ruleAdded;
    }
public function addNamedGroupingPolicy($ptype, ...$params)
    {
        $ruleAdded = false;
        if (1 == count($params) && is_array($params[0])) {
            $strSlice = $params[0];
            $ruleAdded = $this->addPolicyInternal('g', $ptype, $strSlice);
        } else {
            $policy = [];
            foreach ($params as $param) {
                $policy[] = $param;
            }

            $ruleAdded = $this->addPolicyInternal('g', $ptype, $policy);
        }

        if ($this->autoBuildRoleLinks) {
            $this->buildRoleLinks();
        }

        return $ruleAdded;
    }
public function addNamedGroupingPolicy ( $ ptype , ... $ params ) { $ ruleAdded = false ; if ( 1 == count ( $ params ) && is_array ( $ params [ 0 ] ) ) { $ strSlice = $ params [ 0 ] ; $ ruleAdded = $ this -> addPolicyInternal ( 'g' , $ ptype , $ strSlice ) ; } else { $ policy = [ ] ; foreach ( $ params as $ param ) { $ policy [ ] = $ param ; } $ ruleAdded = $ this -> addPolicyInternal ( 'g' , $ ptype , $ policy ) ; } if ( $ this -> autoBuildRoleLinks ) { $ this -> buildRoleLinks ( ) ; } return $ ruleAdded ; }
AddNamedGroupingPolicy adds a named role inheritance rule to the current policy.
If the rule already exists, the function returns false and the rule will not be added.
Otherwise the function returns true by adding the new rule.

@param $ptype
@param mixed ...$params

@return bool
AddNamedGroupingPolicy adds a named role inheritance rule to the current policy . If the rule already exists the function returns false and the rule will not be added . Otherwise the function returns true by adding the new rule .