UNPKG

@refinedev/core

Version:

Refine is a React meta-framework for building enterprise-level, data-intensive applications rapidly with support for modern UI libraries and headless integrations.

10 lines (9 loc) 222 B
export const hasPermission = ( permissions: string[] | undefined, action: string | undefined, ): boolean => { if (!permissions || !action) { return false; } return !!permissions.find((i) => i === action); };