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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user