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

# Is Authorized

> Check if a user has RBAC authorization for specific resources using the Stytch React Native SDK

export const organization = "Represents an instance or tenant in your application, typically mapping to each of your top-level customers.";

export const member = "Represents an individual end user's account within a given Organization, uniquely identified within that Organization by their email address.";

export const isReact_0 = true

{isReact_0 &&
<Info>
  In React, use the <a href="../../hooks/use-stytch-is-authorized"><code>useStytchIsAuthorized</code></a> hook to easily access the Member's authorization and react to changes.
</Info>
}

`rbac.isAuthorized` is an asynchronous method that returns an authorization verdict on a resource-action pair (that is, whether the logged-in <Tooltip tip={member}>Member</Tooltip> is authorized to perform the specified action on the specified Resource).

Given a resource and action, this method will return a promise that resolve to a boolean value, indicating if the Member is authorized to perform the action on the resource.  Returns `true` if the member can perform the action, `false` otherwise.

If the Member is not logged in, this method will always return `false`. If the resource or action provided are not valid for the configured RBAC policy, this method will return `false`. If the role is granted a `*` wildcard for all actions related to the resource, this method will return `true`.

<Note>
  As a best practice, authorization checks for sensitive actions should also occur on the backend.
</Note>

## Parameters

<ParamField path="resource_id" type="string" required>
  The human-readable ID of the resource to check authorization for.
</ParamField>

<ParamField path="action" type="string" required>
  The action to take on the specified resource.
</ParamField>

## Response

<ResponseField name="authorized" type="Promise<boolean>" required>
  `true` if the Member is authorized to perform the specified action on the specified resource, `false` otherwise.

  Will resolve to `false` if the RBAC policy has not been loaded or if the resource or action provided are not valid for the configured RBAC policy.
</ResponseField>

<Panel>
  <RequestExample>
    ```jsx theme={null}
    import { useEffect, useState } from 'react';
    import { View, Text, TouchableOpacity } from 'react-native';
    import { useStytchB2BClient } from '@stytch/react-native/b2b';

    export const AdminPanel = () => {
      const stytch = useStytchB2BClient();
      const [isAuthorized, setIsAuthorized] = useState(false);

      useEffect(() => {
        stytch.rbac
          .isAuthorized('documents', 'edit')
          .then((authorized) => setIsAuthorized(authorized));
      }, [stytch]);

      return isAuthorized ? (
        <TouchableOpacity>
          <Text>Edit Document</Text>
        </TouchableOpacity>
      ) : (
        <Text>You don't have permission to edit documents</Text>
      );
    };
    ```
  </RequestExample>
</Panel>
