feat: write REST API endpoint to create role

This commit is contained in:
Ali BARIN
2024-09-03 13:55:18 +00:00
parent 81beedede6
commit 2709491d59
4 changed files with 175 additions and 0 deletions

View File

@@ -2,11 +2,20 @@ import { Router } from 'express';
import { authenticateUser } from '../../../../helpers/authentication.js';
import { authorizeAdmin } from '../../../../helpers/authorization.js';
import { checkIsEnterprise } from '../../../../helpers/check-is-enterprise.js';
import createRoleAction from '../../../../controllers/api/v1/admin/roles/create-role.ee.js';
import getRolesAction from '../../../../controllers/api/v1/admin/roles/get-roles.ee.js';
import getRoleAction from '../../../../controllers/api/v1/admin/roles/get-role.ee.js';
const router = Router();
router.post(
'/',
authenticateUser,
authorizeAdmin,
checkIsEnterprise,
createRoleAction
);
router.get(
'/',
authenticateUser,