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.
An RBAC policy is a governing document that defines what actions a given Role can take on a given Resource.
To learn more about creating and managing your RBAC policy, see the RBAC guides .
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 .
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 >
);
};