Authorized.jsx 316 Bytes
Newer Older
徐立's avatar
徐立 committed
1 2 3 4
import React from 'react';
import check from './CheckPermissions';

const Authorized = ({ children, authority, noMatch = null }) => {
5 6 7
	const childrenRender = typeof children === 'undefined' ? null : children;
	const dom = check(authority, childrenRender, noMatch);
	return <>{dom}</>;
徐立's avatar
徐立 committed
8 9 10
};

export default Authorized;