fix(xen-api/call): allow *.get_all_records in read only

This commit is contained in:
Julien Fontanet 2021-03-09 17:00:16 +01:00
parent 5cca5d69af
commit b32dc0e450

View File

@ -1,3 +1,6 @@
const RE = /^[^.]+\.get_/
export default (method, args) => args.length === 1 && typeof args[0] === 'string' && RE.test(method)
export default function isReadOnlyCall(method, args) {
const n = args.length
return (n === 0 || (n === 1 && typeof args[0] === 'string')) && RE.test(method)
}