@mondaydotcomorg/monday-authorization 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,9 @@ export declare class AuthorizationService {
|
|
|
16
16
|
*/
|
|
17
17
|
static isAuthorized(accountId: number, userId: number, resources: Resource[], action: Action): Promise<AuthorizeResponse>;
|
|
18
18
|
static isAuthorized(accountId: number, userId: number, authorizationRequestObjects: AuthorizationObject[]): Promise<AuthorizeResponse>;
|
|
19
|
-
static isUserGrantedWithFeature(accountId: number, userId: number, featureName: string
|
|
19
|
+
static isUserGrantedWithFeature(accountId: number, userId: number, featureName: string, options?: {
|
|
20
|
+
shouldSkipCache?: boolean;
|
|
21
|
+
}): Promise<boolean>;
|
|
20
22
|
private static fetchIsUserGrantedWithFeature;
|
|
21
23
|
private static getCachedKeyName;
|
|
22
24
|
static canActionInScope(accountId: number, userId: number, action: string, scope: ScopeOptions): Promise<ScopedActionPermit>;
|
|
@@ -76,10 +76,12 @@ class AuthorizationService {
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
static isUserGrantedWithFeature(accountId, userId, featureName) {
|
|
79
|
+
static isUserGrantedWithFeature(accountId, userId, featureName, options = {}) {
|
|
80
|
+
var _a;
|
|
80
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
82
|
let cachedKey = this.getCachedKeyName(userId, featureName);
|
|
82
|
-
|
|
83
|
+
const shouldSkipCache = (_a = options.shouldSkipCache) !== null && _a !== void 0 ? _a : false;
|
|
84
|
+
if (this.redisClient && !shouldSkipCache) {
|
|
83
85
|
let grantedFeatureValue = yield this.redisClient.get(cachedKey);
|
|
84
86
|
if (!(grantedFeatureValue === undefined || grantedFeatureValue === null)) {
|
|
85
87
|
// redis returns the value as string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mondaydotcomorg/monday-authorization",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/"
|
|
34
34
|
],
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "52c4019f473c2444b7c7a7aa0fc9cffe740f2925"
|
|
36
36
|
}
|