Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188919
settable-by.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
711 B
Referenced Files
None
Subscribers
None
settable-by.ts
View Options
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
Details
Attached
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)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment