blob: c085d2ea72fbd0745542e75f12f3b702d5ea0889 [file] [log] [blame]
export default class Policy {
data: string[] = [];
// Accept a policy, e.g ["alice", "data1", "read"]
constructor(policy: string[]) {
this.data = Object.assign(this.data, policy);
}
getAnonymousString(idx: number = 0): string {
const t = this.data[idx];
this.data[idx] = "_";
const ret = this.data.join(",");
this.data[idx] = t;
return ret;
}
}