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
|
||||
|
||||
@@ -9,6 +9,7 @@ import LoadingSpinner from '@/components/LoadingSpinner';
|
||||
|
||||
const MODULES = [
|
||||
{ id: 'contacts', name: 'إدارة جهات الاتصال', nameEn: 'Contact Management' },
|
||||
{ id: 'suppliers', name: 'إدارة الموردين', nameEn: 'Supplier Management' },
|
||||
{ id: 'crm', name: 'إدارة علاقات العملاء', nameEn: 'CRM' },
|
||||
{ id: 'tenders', name: 'إدارة الٍٍٍمناقصات', nameEn: 'Tender Management' },
|
||||
{ id: 'inventory', name: 'المخزون والأصول', nameEn: 'Inventory & Assets' },
|
||||
|
||||
@@ -10,6 +10,7 @@ import LoadingSpinner from '@/components/LoadingSpinner';
|
||||
|
||||
const MODULES = [
|
||||
{ id: 'contacts', name: 'إدارة جهات الاتصال', nameEn: 'Contact Management' },
|
||||
{ id: 'suppliers', name: 'إدارة الموردين', nameEn: 'Supplier Management' },
|
||||
{ id: 'crm', name: 'إدارة علاقات العملاء', nameEn: 'CRM' },
|
||||
{ id: 'tenders', name: 'إدارة المناقصات', nameEn: 'Tender Management' },
|
||||
{ id: 'inventory', name: 'المخزون والأصول', nameEn: 'Inventory & Assets' },
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -551,7 +551,7 @@ const translations = {
|
||||
view: 'عرض',
|
||||
win: 'فوز',
|
||||
lose: 'خسارة',
|
||||
archive: 'أرشفة',
|
||||
delete: 'حذف',
|
||||
deleteDeal: 'حذف الصفقة',
|
||||
markWon: 'تحديد كفائز',
|
||||
markLost: 'تحديد كخاسر',
|
||||
@@ -563,7 +563,7 @@ const translations = {
|
||||
updateSuccess: 'تم تحديث الصفقة بنجاح',
|
||||
winSuccess: 'تم الفوز بالصفقة بنجاح',
|
||||
loseSuccess: 'تم تحديد الصفقة كخاسرة',
|
||||
deleteSuccess: 'تم أرشفة الصفقة بنجاح',
|
||||
deleteSuccess: 'تم حذف الصفقة بنجاح',
|
||||
fixFormErrors: 'يرجى إصلاح أخطاء النموذج',
|
||||
pipelineRequired: 'مسار المبيعات مطلوب',
|
||||
dealNameMin: 'اسم الصفقة يجب أن يكون 3 أحرف على الأقل',
|
||||
|
||||
Reference in New Issue
Block a user