refactor(scripts): remove admin role checks from plugin API endpoints

- Eliminated admin role checks from the create, install, and delete plugin API endpoints to simplify access control.
- Updated the ScriptsPage component to remove unnecessary user role checks, streamlining the installation process for all users.
- Improved UI by consolidating the zip installation button, enhancing user experience during plugin management.
This commit is contained in:
2026-08-30 20:39:25 +07:00
parent 88d3692116
commit 80e9c91b88
2 changed files with 15 additions and 23 deletions
-3
View File
@@ -466,7 +466,6 @@ export default function scriptsPluginFactory(registry) {
fastify.post(
"/plugins/create",
{ onRequest: [fastify.requireAdmin] },
async (req, reply) => {
const body = /** @type {{ id?: string, content?: string, description?: string }} */ (
req.body ?? {}
@@ -498,7 +497,6 @@ export default function scriptsPluginFactory(registry) {
fastify.post(
"/plugins/install",
{ onRequest: [fastify.requireAdmin] },
async (req, reply) => {
const body = /** @type {{
source?: string,
@@ -573,7 +571,6 @@ export default function scriptsPluginFactory(registry) {
fastify.delete(
"/plugins/:id",
{ onRequest: [fastify.requireAdmin] },
async (req, reply) => {
const { id } = /** @type {{ id: string }} */ (req.params);
try {