New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adminforth/foreign-inline-list

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adminforth/foreign-inline-list - npm Package Compare versions

Comparing version 1.0.20 to 1.0.21

10

dist/index.js

@@ -11,2 +11,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { AdminForthPlugin, AdminForthResourcePages } from "adminforth";
import { interpretResource, ActionCheckSource } from "adminforth";
export default class ForeignInlineListPlugin extends AdminForthPlugin {

@@ -25,3 +26,3 @@ constructor(options) {

path: `/plugin/${this.pluginInstanceId}/get_resource`,
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body }) {
handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, adminUser }) {
const resource = this.adminforth.config.resources.find((res) => this.options.foreignResourceId === res.resourceId);

@@ -33,7 +34,10 @@ if (!resource) {

const resourceCopy = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, resource), { plugins: undefined })));
const { allowedActions } = yield interpretResource(adminUser, resource, {}, ActionCheckSource.DisplayButtons);
if (this.options.modifyTableResourceConfig) {
this.options.modifyTableResourceConfig(resourceCopy);
}
return { resource: resourceCopy };
}),
return {
resource: Object.assign(Object.assign({}, resourceCopy), { options: Object.assign(Object.assign({}, resourceCopy.options), { allowedActions }) })
};
})
});

@@ -40,0 +44,0 @@ }

@@ -11,4 +11,4 @@

import { PluginOptions } from "./types.js";
import { interpretResource, ActionCheckSource } from "adminforth";
export default class ForeignInlineListPlugin extends AdminForthPlugin {

@@ -33,3 +33,3 @@ foreignResource: AdminForthResource;

path: `/plugin/${this.pluginInstanceId}/get_resource`,
handler: async ({ body }) => {
handler: async ({ body, adminUser }) => {
const resource = this.adminforth.config.resources.find((res) => this.options.foreignResourceId === res.resourceId);

@@ -41,2 +41,4 @@ if (!resource) {

const resourceCopy = JSON.parse(JSON.stringify({ ...resource, plugins: undefined }));
const { allowedActions } = await interpretResource(adminUser, resource, {}, ActionCheckSource.DisplayButtons);

@@ -46,4 +48,12 @@ if (this.options.modifyTableResourceConfig) {

}
return { resource: resourceCopy };
},
return {
resource: {
...resourceCopy,
options: {
...resourceCopy.options,
allowedActions,
},
}
};
}
});

@@ -50,0 +60,0 @@

{
"name": "@adminforth/foreign-inline-list",
"version": "1.0.20",
"version": "1.0.21",
"description": "AdminForth plugin for adding list of children items to the parent item show page",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc