public function addRight($name)
    {
        $rights = $this->getRights();
        if (count($rights) === 0) {
            $value = 1;
        } else {
            $value = 2 * end($rights);
        }
        $this->rights[$name] = $value;
        return $this;
    }
public function addRight($name)
    {
        $rights = $this->getRights();
        if (count($rights) === 0) {
            $value = 1;
        } else {
            $value = 2 * end($rights);
        }
        $this->rights[$name] = $value;
        return $this;
    }
public function addRight ( $ name ) { $ rights = $ this -> getRights ( ) ; if ( count ( $ rights ) === 0 ) { $ value = 1 ; } else { $ value = 2 * end ( $ rights ) ; } $ this -> rights [ $ name ] = $ value ; return $ this ; }
Add a right to the list. The correct value is calculated automatically.

@param string $name

@return $this
Add a right to the list . The correct value is calculated automatically .