adminforth 1.3.34 → 1.3.37

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.
@@ -301,7 +301,7 @@ export default class ConfigValidator {
301
301
  });
302
302
  res.options.bulkActions = bulkActions;
303
303
  // if pageInjection is a string, make array with one element. Also check file exists
304
- const possibleInjections = ['beforeBreadcrumbs', 'afterBreadcrumbs', 'bottom', 'threeDotsDropdownItems'];
304
+ const possibleInjections = ['beforeBreadcrumbs', 'afterBreadcrumbs', 'bottom', 'threeDotsDropdownItems', 'customActionIcons'];
305
305
  const possiblePages = ['list', 'show', 'create', 'edit'];
306
306
  if (res.options.pageInjections) {
307
307
  Object.entries(res.options.pageInjections).map(([key, value]) => {
@@ -594,9 +594,11 @@ export default class AdminForthRestAPI {
594
594
  if (!action) {
595
595
  return { error: `Action '${actionId}' not found` };
596
596
  }
597
- const execAllowed = yield action.allowed({ adminUser, resource, selectedIds: recordIds, allowedActions });
598
- if (!execAllowed) {
599
- return { error: `Action '${actionId}' is not allowed` };
597
+ if (action.allowed) {
598
+ const execAllowed = yield action.allowed({ adminUser, resource, selectedIds: recordIds, allowedActions });
599
+ if (!execAllowed) {
600
+ return { error: `Action '${actionId}' is not allowed` };
601
+ }
600
602
  }
601
603
  const response = yield action.action({ selectedIds: recordIds, adminUser, resource });
602
604
  return Object.assign({ actionId,
@@ -351,7 +351,7 @@ export default class ConfigValidator implements IConfigValidator {
351
351
  res.options.bulkActions = bulkActions;
352
352
 
353
353
  // if pageInjection is a string, make array with one element. Also check file exists
354
- const possibleInjections = ['beforeBreadcrumbs', 'afterBreadcrumbs', 'bottom', 'threeDotsDropdownItems'];
354
+ const possibleInjections = ['beforeBreadcrumbs', 'afterBreadcrumbs', 'bottom', 'threeDotsDropdownItems', 'customActionIcons'];
355
355
  const possiblePages = ['list', 'show', 'create', 'edit'];
356
356
 
357
357
  if (res.options.pageInjections) {
@@ -687,9 +687,11 @@ export default class AdminForthRestAPI {
687
687
  return { error: `Action '${actionId}' not found` };
688
688
  }
689
689
 
690
- const execAllowed = await action.allowed({ adminUser, resource, selectedIds: recordIds, allowedActions });
691
- if (!execAllowed) {
692
- return { error: `Action '${actionId}' is not allowed` };
690
+ if (action.allowed) {
691
+ const execAllowed = await action.allowed({ adminUser, resource, selectedIds: recordIds, allowedActions });
692
+ if (!execAllowed) {
693
+ return { error: `Action '${actionId}' is not allowed` };
694
+ }
693
695
  }
694
696
  const response = await action.action({selectedIds: recordIds, adminUser, resource});
695
697
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.3.34",
3
+ "version": "1.3.37",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",