Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F12660665
logged-in.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
622 B
Referenced Files
None
Subscribers
None
logged-in.ts
View Options
import
Policy
from
"../../chip-types/policy.js"
;
import
type
{
Context
}
from
"../../main.js"
;
import
{
AllowAll
}
from
"../../datastore/allow-all.js"
;
import
DenyAll
from
"../../datastore/deny-all.js"
;
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
.
i18n
`You are logged in.`
);
}
else
{
return
Policy
.
deny
(
context
.
i18n
`You are not logged in.`
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Nov 28, 15:41 (16 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1061685
Default Alt Text
logged-in.ts (622 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment