160 lines
3.3 KiB
JavaScript
Raw Normal View History

2021-09-04 00:01:07 +02:00
'use strict';
module.exports = {
2021-09-06 10:55:47 +02:00
type: 'admin',
2021-09-04 00:01:07 +02:00
routes: [
{
method: 'GET',
path: '/settings',
handler: 'admin-settings.getSettings',
2021-09-04 00:01:07 +02:00
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
2021-09-04 00:01:07 +02:00
actions: ['plugin::upload.settings.read'],
},
},
],
},
},
{
method: 'PUT',
path: '/settings',
handler: 'admin-settings.updateSettings',
2021-09-04 00:01:07 +02:00
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
2021-09-04 00:01:07 +02:00
actions: ['plugin::upload.settings.read'],
},
},
],
},
},
{
method: 'POST',
path: '/',
handler: 'admin-upload.upload',
2021-09-04 00:01:07 +02:00
config: {
policies: ['admin::isAuthenticatedAdmin'],
},
},
{
method: 'GET',
path: '/files',
handler: 'admin-file.find',
2021-09-04 00:01:07 +02:00
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
2021-09-04 00:01:07 +02:00
actions: ['plugin::upload.read'],
},
},
],
},
},
{
method: 'GET',
path: '/files/:id',
handler: 'admin-file.findOne',
2021-09-04 00:01:07 +02:00
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
2021-09-04 00:01:07 +02:00
actions: ['plugin::upload.read'],
},
},
],
},
},
{
method: 'DELETE',
path: '/files/:id',
handler: 'admin-file.destroy',
2021-09-04 00:01:07 +02:00
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
2021-09-04 00:01:07 +02:00
actions: ['plugin::upload.assets.update'],
},
},
],
},
},
{
method: 'GET',
path: '/folders',
handler: 'admin-folder.find',
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
actions: ['plugin::upload.read'],
},
},
],
},
},
{
method: 'POST',
path: '/folders',
handler: 'admin-folder.create',
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
actions: ['plugin::upload.read'],
},
},
],
},
},
{
method: 'POST',
path: '/folders/batch-delete',
handler: 'admin-folder.deleteMany',
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
actions: ['plugin::upload.read'],
},
},
],
},
},
2022-04-07 18:00:21 +02:00
{
method: 'GET',
path: '/folder-structure',
handler: 'admin-folder.getStructure',
2022-04-07 18:00:21 +02:00
config: {
policies: [
'admin::isAuthenticatedAdmin',
{
name: 'admin::hasPermissions',
config: {
actions: ['plugin::upload.read'],
},
},
],
},
},
2021-09-04 00:01:07 +02:00
],
};