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