Is There Any Manifest Permission for activeDocument.filePath in InDesign UXP?

hello sir I have use metaPreferences
but this not work
const getXmpData = () => {

var doc = app.activeDocument;

var xmpStr = doc.metadataPreferences.metadata;

if (!xmpStr || xmpStr.length === 0) {

  console.log("No metadata found.");

  return;

}

var xmp = new XMPMeta(xmpStr);

var customNS = "http://your.custom.namespace/";

var prefix = "fileInfo";

XMPMeta.registerNamespace(customNS, prefix);

var prop = xmp.getProperty(customNS, "rawData");

if (prop) {

  console.log("Custom metadata:\\n" + prop.value);

} else {

  console.log("Custom metadata not found.");

}

};
I have question metaPreferences only work extendscript not uxp?
I have direct access without external link xmlFile activeDocument rawData ? get and add,update and delete?