> ## 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-javadoc">
  <ul className="member-list">
    <li>
      <div className="section detail" id="hasRole(com.gpudb.protocol.HasRoleRequest)">
        <h3>hasRole</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/HasRoleResponse" title="class in com.gpudb.protocol">HasRoleResponse</a></span> <span className="element-name">hasRole</span><wbr /><span className="parameters">(<a href="/content/api/java/com/gpudb/protocol/HasRoleRequest" title="class in com.gpudb.protocol">HasRoleRequest</a> request)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Checks if the specified user has the specified role.</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>request</code> - <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest" title="class in com.gpudb.protocol"><code>Request</code></a> object containing the parameters for the operation.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/HasRoleResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="hasRole(java.lang.String,java.lang.String,java.util.Map)">
        <h3>hasRole</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/HasRoleResponse" title="class in com.gpudb.protocol">HasRoleResponse</a></span> <span className="element-name">hasRole</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> principal, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> role, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link">Map</a>\<<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>,<wbr /><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>> options)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Checks if the specified user has the specified role.</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>principal</code> - 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 ''.</div>
          <div className="dd"><code>role</code> - Name of role to check for membership.</div>

          <div className="dd">
            <code>options</code> - Optional parameters.

            <ul>
              <li>
                <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#NO_ERROR_IF_NOT_EXISTS"><code>NO\_ERROR\_IF\_NOT\_EXISTS</code></a>: If <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#FALSE"><code>FALSE</code></a> will return an error if the provided <code>role</code> does not exist or is blank. If <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#TRUE"><code>TRUE</code></a> then it will return <a href="/content/api/java/com/gpudb/protocol/HasRoleResponse.HasRole#FALSE"><code>FALSE</code></a> for <a href="/content/api/java/com/gpudb/protocol/HasRoleResponse#getHasRole()"><code>hasRole</code></a>. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#TRUE"><code>TRUE</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#FALSE"><code>FALSE</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#FALSE"><code>FALSE</code></a>.
              </li>

              <li>
                <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#ONLY_DIRECT"><code>ONLY\_DIRECT</code></a>: If <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#FALSE"><code>FALSE</code></a> will search recursively if the <code> principal</code> is a member of <code>role</code>. If <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#TRUE"><code>TRUE</code></a> then <code>principal</code> must directly be a member of <code>role</code>. Supported values:

                <ul>
                  <li><a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#TRUE"><code>TRUE</code></a> </li>
                  <li><a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#FALSE"><code>FALSE</code></a> </li>
                </ul>

                The default value is <a href="/content/api/java/com/gpudb/protocol/HasRoleRequest.Options#FALSE"><code>FALSE</code></a>.
              </li>
            </ul>

            The default value is an empty <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link"><code>Map</code></a>.
          </div>

          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/HasRoleResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>
  </ul>
</div>
