80 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2021-09-07 09:45:45 +02:00
'use strict';
module.exports = [
{
method: 'GET',
path: '/roles/:id',
handler: 'role.findOne',
2021-09-07 09:45:45 +02:00
config: {
policies: [
{
name: 'admin::hasPermissions',
config: {
2021-09-07 09:45:45 +02:00
actions: ['plugin::users-permissions.roles.read'],
},
},
],
},
},
{
method: 'GET',
path: '/roles',
handler: 'role.find',
2021-09-07 09:45:45 +02:00
config: {
policies: [
{
name: 'admin::hasPermissions',
config: {
2021-09-07 09:45:45 +02:00
actions: ['plugin::users-permissions.roles.read'],
},
},
],
},
},
{
method: 'POST',
path: '/roles',
handler: 'role.createRole',
config: {
policies: [
{
name: 'admin::hasPermissions',
config: {
2021-09-07 09:45:45 +02:00
actions: ['plugin::users-permissions.roles.create'],
},
},
],
},
},
{
method: 'PUT',
path: '/roles/:role',
handler: 'role.updateRole',
config: {
policies: [
{
name: 'admin::hasPermissions',
config: {
2021-09-07 09:45:45 +02:00
actions: ['plugin::users-permissions.roles.update'],
},
},
],
},
},
{
method: 'DELETE',
path: '/roles/:role',
handler: 'role.deleteRole',
config: {
policies: [
{
name: 'admin::hasPermissions',
config: {
2021-09-07 09:45:45 +02:00
actions: ['plugin::users-permissions.roles.delete'],
},
},
],
},
},
];