src/Client.php
public function grantRolePermission($role, $permType, $key, $rangeEnd = null)
    {
        $params = [
            'name' => $role,
            'perm' => [
                'permType' => $permType,
                'key' => base64_encode($key),
            ],
        ];
        if ($rangeEnd !== null) {
            $params['perm']['range_end'] = base64_encode($rangeEnd);
        }

        $body = $this->request(self::URI_AUTH_ROLE_GRANT, $params);

        return $body;
    }
public function grantRolePermission($role, $permType, $key, $rangeEnd = null)
    {
        $params = [
            'name' => $role,
            'perm' => [
                'permType' => $permType,
                'key' => base64_encode($key),
            ],
        ];
        if ($rangeEnd !== null) {
            $params['perm']['range_end'] = base64_encode($rangeEnd);
        }

        $body = $this->request(self::URI_AUTH_ROLE_GRANT, $params);

        return $body;
    }
public function grantRolePermission ( $ role , $ permType , $ key , $ rangeEnd = null ) { $ params = [ 'name' => $ role , 'perm' => [ 'permType' => $ permType , 'key' => base64_encode ( $ key ) , ] , ] ; if ( $ rangeEnd !== null ) { $ params [ 'perm' ] [ 'range_end' ] = base64_encode ( $ rangeEnd ) ; } $ body = $ this -> request ( self :: URI_AUTH_ROLE_GRANT , $ params ) ; return $ body ; }
grant a permission of a specified key or range to a specified role.

@param string      $role
@param int         $permType
@param string      $key
@param string|null $rangeEnd
@return array
@throws \GuzzleHttp\Exception\BadResponseException
grant a permission of a specified key or range to a specified role .