> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# hasRole

<div className="kinetica-doxygen">
  <div id="a9de0d2bb24bdfa17ea915c8c29ab9f06" />

  <h2 className="memtitle"><span className="permalink"><a href="#a9de0d2bb24bdfa17ea915c8c29ab9f06">◆ </a></span>hasRole() <span className="overload">\[1/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">HasRoleResponse</a> gpudb::GPUdb::hasRole </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleRequest">HasRoleRequest</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">request\_</span></span></td>
          <td>)</td>
          <td> const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Checks if the specified user has the specified role. </p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">request\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleRequest">Request</a> object containing the parameters for the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="a5b8c49a68512e098f534b4ad4345080e" />

  <h2 className="memtitle"><span className="permalink"><a href="#a5b8c49a68512e098f534b4ad4345080e">◆ </a></span>hasRole() <span className="overload">\[2/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">HasRoleResponse</a> & gpudb::GPUdb::hasRole </td>
          <td>(</td>
          <td className="paramtype">const <a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleRequest">HasRoleRequest</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">request\_</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">HasRoleResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Checks if the specified user has the specified role. </p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">request\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleRequest">Request</a> object containing the parameters for the operation. </td>
            </tr>

            <tr>
              <td className="paramdir">\[out]</td>
              <td className="paramname">response\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">Response</a> object containing the results of the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>

  <div id="ac09bb999e6f1d7e839949498beb2a0d7" />

  <h2 className="memtitle"><span className="permalink"><a href="#ac09bb999e6f1d7e839949498beb2a0d7">◆ </a></span>hasRole() <span className="overload">\[3/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">HasRoleResponse</a> gpudb::GPUdb::hasRole </td>
          <td>(</td>
          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">principal</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">role</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::map\< std::string, std::string > &</td>
          <td className="paramname"><span className="paramname"><span className="em">options</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Checks if the specified user has the specified role. </p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">principal</td>
              <td>Name of the user for which role membership is being checked. Must be an existing user. If blank, will use the current user. The default value is ''. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">role</td>
              <td>Name of role to check for membership. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">options</td>

              <td>
                Optional parameters.

                <ul>
                  <li>
                    <a className="el" href="/content/api/cpp/namespacegpudb#aacf51814d2a53ab6e98ce65fa0acf955">has\_role\_no\_error\_if\_not\_exists</a>: If <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">false</a> will return an error if the provided <span className="em arg">role</span> does not exist or is blank. If <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">true</a> then it will return <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">false</a> for <a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse#a9fb645db6c469a4a10e59b4e823461fa">hasRole</a>. Supported values:

                    <ul>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">has\_role\_true</a> </li>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a> </li>
                    </ul>

                    The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a>.
                  </li>

                  <li>
                    <a className="el" href="/content/api/cpp/namespacegpudb#a448bac98035ddaa22a4f20f944a91287">has\_role\_only\_direct</a>: If <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">false</a> will search recursively if the <span className="em arg">principal</span> is a member of <span className="em arg">role</span>. If <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">true</a> then <span className="em arg">principal</span> must directly be a member of <span className="em arg">role</span>. Supported values:

                    <ul>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">has\_role\_true</a> </li>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a> </li>
                    </ul>

                    The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a>.
                  </li>
                </ul>

                The default value is an empty map.
              </td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">Response</a> object containing the result of the operation. </div>
      </div>
    </div>
  </div>

  <div id="a11a614337a040e473f85b6dbd9b03cc2" />

  <h2 className="memtitle"><span className="permalink"><a href="#a11a614337a040e473f85b6dbd9b03cc2">◆ </a></span>hasRole() <span className="overload">\[4/4]</span></h2>

  <div className="memitem">
    <div className="memproto">
      <table className="memname">
        <tr>
          <td className="memname"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">HasRoleResponse</a> & gpudb::GPUdb::hasRole </td>
          <td>(</td>
          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">principal</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::string &</td>
          <td className="paramname"><span className="paramname"><span className="em">role</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype">const std::map\< std::string, std::string > &</td>
          <td className="paramname"><span className="paramname"><span className="em">options</span></span>, </td>
        </tr>

        <tr>
          <td className="paramkey" />

          <td />

          <td className="paramtype"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">HasRoleResponse</a> &</td>
          <td className="paramname"><span className="paramname"><span className="em">response\_</span></span> ) const</td>
        </tr>
      </table>
    </div>

    <div className="memdoc">
      <p>Checks if the specified user has the specified role. </p>

      <div className="dl params">
        <div className="dt">Parameters</div>

        <div className="dd">
          <table className="params">
            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">principal</td>
              <td>Name of the user for which role membership is being checked. Must be an existing user. If blank, will use the current user. The default value is ''. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">role</td>
              <td>Name of role to check for membership. </td>
            </tr>

            <tr>
              <td className="paramdir">\[in]</td>
              <td className="paramname">options</td>

              <td>
                Optional parameters.

                <ul>
                  <li>
                    <a className="el" href="/content/api/cpp/namespacegpudb#aacf51814d2a53ab6e98ce65fa0acf955">has\_role\_no\_error\_if\_not\_exists</a>: If <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">false</a> will return an error if the provided <span className="em arg">role</span> does not exist or is blank. If <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">true</a> then it will return <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">false</a> for <a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse#a9fb645db6c469a4a10e59b4e823461fa">hasRole</a>. Supported values:

                    <ul>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">has\_role\_true</a> </li>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a> </li>
                    </ul>

                    The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a>.
                  </li>

                  <li>
                    <a className="el" href="/content/api/cpp/namespacegpudb#a448bac98035ddaa22a4f20f944a91287">has\_role\_only\_direct</a>: If <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">false</a> will search recursively if the <span className="em arg">principal</span> is a member of <span className="em arg">role</span>. If <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">true</a> then <span className="em arg">principal</span> must directly be a member of <span className="em arg">role</span>. Supported values:

                    <ul>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a7a9e6d715315aec0f6eb6ceb3c6a5a55">has\_role\_true</a> </li>
                      <li> <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a> </li>
                    </ul>

                    The default value is <a className="el" href="/content/api/cpp/namespacegpudb#a75680d2b8b9603da05dcd22794162a06">has\_role\_false</a>.
                  </li>
                </ul>

                The default value is an empty map.
              </td>
            </tr>

            <tr>
              <td className="paramdir">\[out]</td>
              <td className="paramname">response\_</td>
              <td><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">Response</a> object containing the results of the operation.</td>
            </tr>
          </table>
        </div>
      </div>

      <div className="dl section return">
        <div className="dt">Returns</div>
        <div className="dd"><a className="el" href="/content/api/cpp/structgpudb_1_1HasRoleResponse">Response</a> object containing the result of the operation (initially passed in by reference). </div>
      </div>
    </div>
  </div>
</div>
