Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188334
access-strategy.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
900 B
Referenced Files
None
Subscribers
None
access-strategy.js
View Options
const
locreq
=
require
(
"locreq"
)(
__dirname
);
const
Promise
=
require
(
"bluebird"
);
const
AccessStrategyType
=
locreq
(
"lib/chip-types/access-strategy-type.js"
);
const
AccessStrategy
=
function
(
declaration
){
if
(
declaration
instanceof
Array
){
this
.
type
=
new
AccessStrategyType
(
declaration
[
0
]);
this
.
params
=
declaration
[
1
]
||
{};
}
else
if
(
typeof
declaration
===
"string"
||
declaration
instanceof
AccessStrategyType
){
this
.
type
=
new
AccessStrategyType
(
declaration
);
this
.
params
=
{};
}
else
{
this
.
type
=
new
AccessStrategyType
(
declaration
.
type
);
this
.
params
=
declaration
.
params
||
{};
}
};
AccessStrategy
.
prototype
=
new
function
(){
this
.
check
=
function
(
context
,
item
){
return
Promise
.
resolve
(
this
.
type
.
check
(
context
,
this
.
params
,
item
));
};
this
.
is_item_sensitive
=
function
(){
return
this
.
type
.
is_item_sensitive
(
this
.
params
);
};
};
module
.
exports
=
AccessStrategy
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jul 8, 08:08 (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
810440
Default Alt Text
access-strategy.js (900 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment