fix(basic.gblib): ALLOW ROLE return people.

This commit is contained in:
Rodrigo Rodriguez 2024-02-24 17:48:41 -03:00
parent e08a02bec0
commit d00553380e
2 changed files with 8 additions and 1 deletions

View file

@ -1353,7 +1353,7 @@ export class DialogKeywords {
const driveUrl = template['@microsoft.graph.downloadUrl'];
const res = await fetch(driveUrl);
let buf: any = Buffer.from(await res.arrayBuffer());
let localName1 = Path.join('work', gbaiName, 'cache', `tmp${GBAdminService.getRndReadableIdentifier()}.${ext}`);
let localName1 = Path.join('work', gbaiName, 'cache', `${fileOnly}-${GBAdminService.getRndReadableIdentifier()}.${ext}`);
Fs.writeFileSync(localName1, buf, { encoding: null });
url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', Path.basename(localName1));

View file

@ -743,6 +743,13 @@ export class KeywordsExpressions {
}
];
keywords[i++] = [
/^\s*((?:[a-z]+.?)(?:(?:\w+).)(?:\w+)*)\s*=\s*(ALLOW ROLE)(\s*)(.*)/gim,
($0, $1, $2, $3, $4) => {
return `${$1} = await dk.allowRole ({pid: pid, role: ${$4}})`;
}
];
keywords[i++] = [
/^\s*(set filter)(\s*)(.*)/gim,
($0, $1, $2, $3) => {