import { useCallback } from 'react';
import { checkConfigPermission, ConfigPermissions } from '@reltio/mdm-sdk';
import { useMdmUserRoles } from '../../contexts/MdmModuleContext';
var emptyArray = [];
export var useConfigPermissions = function () {
    var userRoles = useMdmUserRoles() || emptyArray;
    return {
        canCreate: useCallback(checkConfigPermission(ConfigPermissions.CREATE, userRoles), [userRoles]),
        canRead: useCallback(checkConfigPermission(ConfigPermissions.READ, userRoles), [userRoles]),
        canUpdate: useCallback(checkConfigPermission(ConfigPermissions.UPDATE, userRoles), [userRoles]),
        canDelete: useCallback(checkConfigPermission(ConfigPermissions.DELETE, userRoles), [userRoles])
    };
};
