Commit 04d22756 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Sandbox: keep `pubkey` + add `issuer` control

parent 5a190a7a
export interface DBDocument {
issuers: string[];
pubkey?: string
issuer?: string
issuers?: string[]
}
\ No newline at end of file
import { DBDocument } from './DocumentDAL';
import {DBDocument} from './DocumentDAL';
export class SandBox<T extends DBDocument> {
......@@ -13,7 +13,9 @@ export class SandBox<T extends DBDocument> {
}
async acceptNewSandBoxEntry(element:T, pubkey:string) {
if (element.issuers !== undefined && element.issuers.indexOf(pubkey) !== -1) {
if (element.pubkey === pubkey
|| element.issuer === pubkey
|| (element.issuers !== undefined && element.issuers.indexOf(pubkey) !== -1)) {
return true;
}
const elements = await this.findElements()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment