UNPKG

bananas-commerce-admin

Version:

What's this, an admin for apes?

11 lines (9 loc) 290 B
import { User } from "../contexts/UserContext"; export function hasPermission( user: User | null | undefined, permission: string | null | undefined, ): boolean { if (user == null) return false; if (permission == null) return true; return user.permissions.includes(permission); }