Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22404584
not.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
878 B
Referenced Files
None
Subscribers
None
not.js
View Options
const
assert
=
require
(
"assert"
);
const
Op
=
require
(
"sequelize"
).
Op
;
const
AccessStrategy
=
require
(
"./access-strategy.js"
);
module
.
exports
=
AccessStrategy
.
WithParams
(
class
Not
extends
AccessStrategy
{
constructor
(...
params
)
{
super
(...
params
);
this
.
child_access_strategy
=
params
[
0
];
assert
(
this
.
child_access_strategy
instanceof
AccessStrategy
);
}
async
filterModelQuery
(
app
,
context
)
{
return
{
[
Op
.
not
]
:
await
this
.
child_access_strategy
.
filterModelQuery
(
app
,
context
),
};
}
async
checkItem
(
app
,
context
,
item
)
{
if
(
(
await
this
.
child_access_strategy
.
checkItem
(
app
,
context
,
item
)).
allowed
)
{
// we could think about constructing a human-readable error message here, but for now it seems too messy
return
AccessStrategy
.
deny
(
"Access denied"
);
}
else
{
return
AccessStrategy
.
allow
();
}
}
}
);
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 19:18 (17 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1229478
Default Alt Text
not.js (878 B)
Attached To
Mode
rSREWRITE Sealious-rewrite
Attached
Detach File
Event Timeline