Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996470
owner.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
683 B
Referenced Files
None
Subscribers
None
owner.js
View Options
"use strict"
;
const
Promise
=
require
(
"bluebird"
);
const
Query
=
require
(
"../../../datastore/query.js"
);
module
.
exports
=
{
name
:
"owner"
,
getRestrictingQuery
:
async
function
(
context
,
params
)
{
if
(
context
.
user_id
)
{
return
Query
.
fromSingleMatch
({
"created_context.user_id"
:
{
$eq
:
context
.
user_id
},
});
}
return
new
Query
.
DenyAll
();
},
checker_function
:
function
(
context
,
params
,
item
)
{
if
(
context
.
user_id
&&
context
.
user_id
===
item
.
created_context
.
user_id
)
{
return
Promise
.
resolve
();
}
else
{
return
Promise
.
reject
(
"Only the owner of this resource can perform this operation on this item."
);
}
},
item_sensitive
:
true
,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 14:04 (12 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557278
Default Alt Text
owner.js (683 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment