Page MenuHomeSealhub

logged-in.ts
No OneTemporary

logged-in.ts

import Policy from "../../chip-types/policy";
import type { Context } from "../../main";
import { AllowAll } from "../../datastore/allow-all";
import DenyAll from "../../datastore/deny-all";
export default class LoggedIn extends Policy {
static type_name = "logged-in";
async _getRestrictingQuery(context: Context) {
if (context.user_id) {
return new AllowAll();
}
return new DenyAll();
}
async checkerFunction(context: Context) {
if (context.user_id) {
return Policy.allow(context.app.i18n("policy_logged_in_allow"));
} else {
return Policy.deny(context.app.i18n("policy_logged_in_deny"));
}
}
}

File Metadata

Mime Type
text/x-java
Expires
Mon, Dec 23, 21:45 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
555920
Default Alt Text
logged-in.ts (625 B)

Event Timeline