mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-17 10:36:43 +03:00
12 lines
286 B
TypeScript
12 lines
286 B
TypeScript
|
|
import { useContext } from "react";
|
||
|
|
import { AuthContext } from "@/context/auth-context";
|
||
|
|
|
||
|
|
export function useIsCustomRole() {
|
||
|
|
const { auth } = useContext(AuthContext);
|
||
|
|
return !(
|
||
|
|
auth.user?.role === "admin" ||
|
||
|
|
auth.user?.role == "viewer" ||
|
||
|
|
!auth.isAuthenticated
|
||
|
|
);
|
||
|
|
}
|