Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996385
user-referenced-in-field.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
547 B
Referenced Files
None
Subscribers
None
user-referenced-in-field.js
View Options
module
.
exports
=
app
=>
({
name
:
"user-referenced-in-field"
,
getRestrictingQuery
:
async
(
context
,
field_name
)
=>
{
if
(
!
context
.
user_id
)
return
new
app
.
Query
.
DenyAll
();
return
app
.
Query
.
fromSingleMatch
({
[
field_name
]
:
context
.
user_id
,
});
},
checker_function
:
async
(
context
,
field_name
,
sealious_response
)
=>
{
if
(
!
context
.
user_id
)
return
Promise
.
reject
(
"You're not logged in!"
);
if
(
context
.
user_id
!==
sealious_response
[
field_name
])
return
Promise
.
reject
(
"Access not allowed for this user"
);
},
item_sensitive
:
true
,
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 14:02 (10 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557227
Default Alt Text
user-referenced-in-field.js (547 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment