@fluid-topics/ft-reader-context 1.1.44 → 1.1.46

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.
@@ -30,6 +30,7 @@ export declare abstract class FtReaderService extends FtServiceWithCache {
30
30
  private initCache;
31
31
  clear(): void;
32
32
  getMap(): Promise<FtMap>;
33
+ getMapNow(): FtMap | undefined;
33
34
  getConfiguration(): Promise<FtReaderConfiguration>;
34
35
  private getEnrichedToc;
35
36
  get enrichedToc(): EnrichedToc | undefined;
@@ -36,6 +36,9 @@ export class FtReaderService extends FtServiceWithCache {
36
36
  getMap() {
37
37
  return this.cache.get("map");
38
38
  }
39
+ getMapNow() {
40
+ return this.cache.getNow("map");
41
+ }
39
42
  getConfiguration() {
40
43
  return this.cache.get("configuration");
41
44
  }
@@ -187,6 +190,7 @@ export class FtReaderService extends FtServiceWithCache {
187
190
  return breadcrumb;
188
191
  }
189
192
  isFeatureAccessible(feature, { session, ratingType }) {
193
+ var _a;
190
194
  if (!this.isFeatureAvailable(feature)) {
191
195
  return false;
192
196
  }
@@ -202,7 +206,7 @@ export class FtReaderService extends FtServiceWithCache {
202
206
  case FtReaderFeatures.COLLECTIONS:
203
207
  return userHasRole(session !== null && session !== void 0 ? session : [], FtUserRole.COLLECTION_USER);
204
208
  case FtReaderFeatures.PERSONAL_BOOKS:
205
- return userHasRole(session !== null && session !== void 0 ? session : [], FtUserRole.PERSONAL_BOOK_USER);
209
+ return userHasRole(session !== null && session !== void 0 ? session : [], FtUserRole.PERSONAL_BOOK_USER) && !((_a = this.getMapNow()) === null || _a === void 0 ? void 0 : _a.pbkConfidential);
206
210
  default:
207
211
  return false;
208
212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-context",
3
- "version": "1.1.44",
3
+ "version": "1.1.46",
4
4
  "description": "Context block for integrated reader components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "1.1.44",
23
- "@fluid-topics/ft-wc-utils": "1.1.44",
22
+ "@fluid-topics/ft-app-context": "1.1.46",
23
+ "@fluid-topics/ft-wc-utils": "1.1.46",
24
24
  "@reduxjs/toolkit": "^1.6.2",
25
25
  "lit": "3.1.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluid-topics/public-api": "1.0.61"
29
29
  },
30
- "gitHead": "338d6b90cd29912af999509fb4d399e13a93e54d"
30
+ "gitHead": "023f346e70fcbd9980c41b0c7ede0c199ca699bc"
31
31
  }