> ## 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.

# RBAC (Roles-Based Access Control)

> Enforce RBAC permissions in your application's frontend using the Stytch React Native SDK

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 rbac = "Role-Based Access Control: An authorization model that manages access to resources within your application based on user roles.";

export const isReact_0 = true

An <Tooltip tip={rbac}>RBAC</Tooltip> policy is a governing document that defines what actions a given Role can take on a given Resource.

<Columns cols={2}>
  <Card title="Role Object" icon="braces" href="/docs/api-reference/b2b/api/rbac/role-object" />

  <Card title="Resource Object" icon="braces" href="/docs/api-reference/b2b/api/rbac/resource-object" />
</Columns>

To learn more about creating and managing your RBAC policy, see the [RBAC guides](/docs/multi-tenant-auth/enterprise-ready/rbac/create-rbac-policy).

## Checking permissions

Each Member Session will be granted specific roles, which grants them permission to take specific actions on specific Resources. To check if a Member has permission to take an action on a Resource, use the {isReact_0 ? <><a href="../../hooks/use-stytch-is-authorized"><code>useStytchIsAuthorized</code> hook</a></> : <><a href="./is-authorized"><code>isAuthorized</code> method</a></>}.

<Warning>
  Always validate permissions on the client **and** server before proceeding with an action.  See the [Enforcing Permissions guide](/docs/multi-tenant-auth/enterprise-ready/rbac/enforcing-permissions#frontend-authorization-checks) and the [Stytch API Reference](/docs/api-reference/b2b/api/rbac/overview) for more details.
</Warning>

```jsx theme={null}
import { View, Button } from 'react-native';
import { useStytchIsAuthorized } from '@stytch/react-native/b2b';

const DocumentActions = () => {
  const { isAuthorized } = useStytchIsAuthorized('documents', 'edit');

  // Check permissions both before taking actions
  const editDocument = () => {
    if (!isAuthorized) {
      throw new Error('You do not have permission to edit documents');
    }

    proceedWithEdit();
  };

  // And to hide or disable UI elements
  return (
    <View>
      <Button title="Edit Document" disabled={!isAuthorized} onPress={editDocument} />
    </View>
  );
};
```
