@contentful/field-editor-reference 4.3.0 → 4.3.1

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.
@@ -2255,13 +2255,14 @@ function useEditorPermissions(props) {
2255
2255
 
2256
2256
  function _checkCreateAccess() {
2257
2257
  _checkCreateAccess = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
2258
- var canCreate;
2258
+ var canCreate, _canCreate;
2259
+
2259
2260
  return runtime_1.wrap(function _callee$(_context) {
2260
2261
  while (1) {
2261
2262
  switch (_context.prev = _context.next) {
2262
2263
  case 0:
2263
2264
  if (!(entityType === 'Asset')) {
2264
- _context.next = 5;
2265
+ _context.next = 8;
2265
2266
  break;
2266
2267
  }
2267
2268
 
@@ -2269,15 +2270,28 @@ function useEditorPermissions(props) {
2269
2270
  return canPerformAction('create', 'Asset');
2270
2271
 
2271
2272
  case 3:
2272
- canCreate = _context.sent;
2273
+ _context.t0 = _context.sent;
2274
+
2275
+ if (_context.t0) {
2276
+ _context.next = 6;
2277
+ break;
2278
+ }
2279
+
2280
+ _context.t0 = true;
2281
+
2282
+ case 6:
2283
+ canCreate = _context.t0;
2273
2284
  setCanCreateEntity(canCreate);
2274
2285
 
2275
- case 5:
2286
+ case 8:
2276
2287
  if (entityType === 'Entry') {
2277
- setCanCreateEntity(creatableContentTypes.length > 0);
2288
+ // Hardcoded `true` value following https://contentful.atlassian.net/browse/DANTE-486
2289
+ // TODO: refine permissions check in order to account for tags in rules
2290
+ _canCreate = readableContentTypes.length > 0 || true;
2291
+ setCanCreateEntity(_canCreate);
2278
2292
  }
2279
2293
 
2280
- case 6:
2294
+ case 9:
2281
2295
  case "end":
2282
2296
  return _context.stop();
2283
2297
  }