Page MenuHomeSealhub

super.ts
No OneTemporary

super.ts

import Policy from "../../chip-types/policy";
import Context from "../../context";
import DenyAll from "../../datastore/deny-all";
import { AllowAll } from "../../datastore/allow-all";
export default class Super extends Policy {
static type_name = "super";
async _getRestrictingQuery(context: Context) {
if (context.is_super) {
return new AllowAll();
}
return new DenyAll();
}
async checkerFunction(context: Context) {
if (context.is_super) {
return Policy.allow("this method was ran with a supercontext");
} else {
return Policy.deny("this method was not ran with a supercontext");
}
}
isItemSensitive = async (_: Context) => false;
}

File Metadata

Mime Type
text/x-java
Expires
Tue, Jul 8, 08:40 (7 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
802764
Default Alt Text
super.ts (664 B)

Event Timeline