Page MenuHomeSealhub

settable-by.ts
No OneTemporary

settable-by.ts

import Field, { HybridField } from "../../../chip-types/field";
import type { Context } from "../../../main";
import type Policy from "../../../chip-types/policy";
export default class SettableBy<T extends Field> extends HybridField<T> {
typeName = "settable-by";
policy: Policy;
constructor(base_field: T, policy: Policy) {
super(base_field);
this.policy = policy;
}
async isProperValue(
context: Context,
input: Parameters<T["encode"]>[1],
old_value: Parameters<T["encode"]>[2]
) {
const result = await this.policy.check(context);
if (result && !result.allowed) {
return Field.invalid(result.reason);
}
return this.virtual_field.checkValue(context, input, old_value, null);
}
}

File Metadata

Mime Type
text/x-java
Expires
Tue, Jul 8, 08:36 (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
800757
Default Alt Text
settable-by.ts (711 B)

Event Timeline