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

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

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

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

        return $ruleAdded;
    }
public function addNamedPolicy ( $ ptype , ... $ params ) { $ ruleAdded = false ; if ( 1 == count ( $ params ) && is_array ( $ params [ 0 ] ) ) { $ strSlice = $ params [ 0 ] ; $ ruleAdded = $ this -> addPolicyInternal ( 'p' , $ ptype , $ strSlice ) ; } else { $ policy = [ ] ; foreach ( $ params as $ param ) { $ policy [ ] = $ param ; } $ ruleAdded = $ this -> addPolicyInternal ( 'p' , $ ptype , $ policy ) ; } return $ ruleAdded ; }
AddNamedPolicy adds an authorization rule to the current named 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
AddNamedPolicy adds an authorization rule to the current named 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 .