Escalated использует два гейта авторизации для управления доступом к интерфейсам агентов и администраторов. Определите их в вашем приложении, чтобы контролировать, кто может управлять тикетами.
Примечание: Escalated автоматически передаёт page.props.escalated во все ответы Inertia, содержащий префикс маршрута и статус агента/администратора текущего пользователя.
WordPress использует встроенные роли и права доступа. Плагин регистрирует две пользовательские роли:
Роль
Описание
escalated_agent
Может просматривать и управлять тикетами
escalated_admin
Полный доступ к настройкам, отделам и политикам SLA
Authorization is handled entirely server-side. The Flutter package sends a Bearer token with each request, and your backend API controls what the authenticated user can access.
There are no client-side gates to define — the mobile app is a customer-facing UI, so agent and admin authorization checks only apply on the web.
Checking Auth State
Use the authProvider to check whether the current user is authenticated:
final authState = ref.watch(authProvider);
if (authState.isAuthenticated) {
// User is logged in, show ticket list
} else {
// Show login screen
}
Note: The escalated-agent and escalated-admin gates from your backend still apply to all API requests. The mobile app simply doesn't expose agent or admin views.
Authorization is handled entirely server-side. The React Native package sends a Bearer token with each request, and your backend API controls what the authenticated user can access.
There are no client-side gates to define — the mobile app is a customer-facing UI, so agent and admin authorization checks only apply on the web.
Checking Auth State
Use the useAuth hook to access the current user and authentication status:
import { useAuth } from '@escalated-dev/escalated-react-native';
function ProfileScreen() {
const { user, isAuthenticated } = useAuth();
if (!isAuthenticated) {
return <LoginScreen />;
}
return <Text>Welcome, {user.name}</Text>;
}
Note: The escalated-agent and escalated-admin gates from your backend still apply to all API requests. The mobile app simply doesn't expose agent or admin views.