UNPKG

@refinedev/core

Version:

refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.

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); };