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

# Permissions

> Get user RBAC permissions using the Stytch React Native SDK

`rbac.allPermissions` is an asynchronous method that returns the complete list of permissions assigned to the currently logged-in User. If the User is not logged in, all values will be false.

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

## Response

<ResponseField name="permissions" type="Promise<Record<RoleId, Record<Action, boolean>>>" required>
  A promise that resolves to a map of all permissions assigned to the currently logged-in User.

  The key is the human-readable ID of the role, and the value is a map of all actions for the given role. The boolean value signifies whether the User has permission (true) or not (false) to perform the specified action.
</ResponseField>

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

    export const MyComponent = () => {
      const [allPermissions, setAllPermissions] = useState<PermissionsMap<Record<string, string>>>();

      const stytch = useStytch();

      useEffect(() => {
        stytch.rbac.allPermissions().then((response) => setAllPermissions(response));
      }, [stytch]);

      if (!allPermissions) {
        return <Text>Loading...</Text>;
      }

      const canEditDocuments = allPermissions['document']['edit'];

      const editDocument = () => {
        /* ... */
      };

      return (
        <View>
          <TouchableOpacity disabled={!canEditDocuments} onPress={editDocument}>
            <Text>Edit Document</Text>
          </TouchableOpacity>
        </View>
      );
    };
    ```
  </RequestExample>

  <ResponseExample>
    ```json theme={null}
    {
        "stytch_permissions": {
          "documents": {
            "edit": false,
            "read": true,
          },
          "images": {
            "create": false,
            "view": true,
          },
        },
    }
    ```
  </ResponseExample>
</Panel>
