add permission to suppliers
This commit is contained in:
@@ -1624,3 +1624,12 @@ model Approval {
|
||||
@@map("approvals")
|
||||
}
|
||||
|
||||
model SystemSetting {
|
||||
key String @id
|
||||
value String
|
||||
category String @default("general")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@map("system_settings")
|
||||
}
|
||||
@@ -8,13 +8,13 @@ const router = Router();
|
||||
|
||||
router.use(authenticate);
|
||||
|
||||
router.get('/', authorize('contacts', 'contacts', 'read'), suppliersController.findAll);
|
||||
router.get('/stats', authorize('contacts', 'contacts', 'read'), suppliersController.getStats);
|
||||
router.get('/export', authorize('contacts', 'contacts', 'read'), suppliersController.export);
|
||||
router.get('/', authorize('suppliers', 'suppliers', 'read'), suppliersController.findAll);
|
||||
router.get('/stats', authorize('suppliers', 'suppliers', 'read'), suppliersController.getStats);
|
||||
router.get('/export', authorize('suppliers', 'suppliers', 'read'), suppliersController.export);
|
||||
|
||||
router.get(
|
||||
'/:id',
|
||||
authorize('contacts', 'contacts', 'read'),
|
||||
authorize('suppliers', 'suppliers', 'read'),
|
||||
param('id').isUUID(),
|
||||
validate,
|
||||
suppliersController.findById
|
||||
@@ -22,7 +22,7 @@ router.get(
|
||||
|
||||
router.post(
|
||||
'/',
|
||||
authorize('contacts', 'contacts', 'create'),
|
||||
authorize('suppliers', 'suppliers', 'create'),
|
||||
[
|
||||
body('name').optional({ values: 'falsy' }).trim(),
|
||||
body('companyName').optional({ values: 'falsy' }).trim(),
|
||||
@@ -40,7 +40,7 @@ router.post(
|
||||
|
||||
router.put(
|
||||
'/:id',
|
||||
authorize('contacts', 'contacts', 'update'),
|
||||
authorize('suppliers', 'suppliers', 'update'),
|
||||
[
|
||||
param('id').isUUID(),
|
||||
body('email')
|
||||
@@ -57,7 +57,7 @@ router.put(
|
||||
|
||||
router.post(
|
||||
'/:id/archive',
|
||||
authorize('contacts', 'contacts', 'archive'),
|
||||
authorize('suppliers', 'suppliers', 'archive'),
|
||||
param('id').isUUID(),
|
||||
validate,
|
||||
suppliersController.archive
|
||||
|
||||
Reference in New Issue
Block a user