You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,8 @@ commtrackr.init({ // Initialize CommTracker with configurations
87
87
value:'Cancelled'
88
88
}
89
89
],
90
-
disableFieldEditing: ['amount', 'currency'] // Array of field IDs that admins cannot edit
90
+
disableFieldEditing: ['amount', 'currency'], // Array of field IDs that admins cannot edit
91
+
users:'users'// req.session object variable for all users array
91
92
},
92
93
fields: [
93
94
{
@@ -120,7 +121,7 @@ commtrackr.init({ // Initialize CommTracker with configurations
120
121
// data contains the updated commission object
121
122
// The constant data.id contains the unique commission ID
122
123
// Action metadata can be accessed via data.updatedAt, data.updatedBy, and data.sendEmail
123
-
// Updated metadata can be accessed via data.user, data.amount, data.currency, data.date, data.status, and data.locked
124
+
// Updated metadata can be accessed via data.user, data.amount, data.currency, data.date, data.status, data.locked, and data.assignedTo
124
125
// Updated fields can be accessed via data.fields
125
126
},
126
127
sync: (req) => {
@@ -166,7 +167,7 @@ Session Example: `'John Doe'`
166
167
167
168
### role
168
169
169
-
`role` should contain the role of the user: 'admin', `dev`, or 'user'. This is used to control access to certain features and functionalities within CommTrackr.
170
+
`role` should contain the role of the user: `'admin'`, `'dev'`, or `'user'`. This is used to control access to certain features and functionalities within CommTrackr.
170
171
171
172
Type: `String`
172
173
@@ -190,7 +191,7 @@ Default:
190
191
191
192
### access
192
193
193
-
`access` can be used as an alternative to `role` for access control. It should contain numeric access levels. Use the `access` configuration to define which levels correspond to 'user', 'dev', and 'admin'.
194
+
`access` can be used as an alternative to `role` for access control. It should contain numeric access levels. Use the `access` configuration to define which levels correspond to `'user'`, `'dev'`, and `'admin'`.
194
195
195
196
Type: `Array`
196
197
@@ -234,7 +235,8 @@ Session Example:
234
235
label:'Link Label', // Link label
235
236
url:'http://example.com'// Link URL
236
237
}
237
-
]
238
+
],
239
+
assignedTo: ['dev1UserId', 'dev2UserId'] // Array of userIds of the developers assigned to this commission
238
240
}
239
241
]
240
242
```
@@ -262,3 +264,11 @@ Default:
262
264
```javascript
263
265
[]
264
266
```
267
+
268
+
### users
269
+
270
+
`users` should contain an array of all users and developers in the system. Each user object should have at least `userId` and defined matching `role` or `access.var` properties. `userName` property is recommended, but not required. This is used for assigning commissions to owners and developers.
if(!commission)returnres.status(404).render('error',{ tenant,title: 'Not Found',message: 'The requested commission was not found.'});
262
267
if(commission.locked&&(getUserRole(req.session)==='user'))returnres.status(403).render('error',{ tenant,title: 'Forbidden',message: 'You do not have permission to edit this commission.'});
if(!tenant.slug||!tenant.name||!tenant.domain)returnres.status(500).json({status: 'error',message: 'Service is not properly configured. Please contact the administrator.'});
if(commission.locked&&(getUserRole(req.session)==='user'))returnres.status(403).json({status: 'error',message: 'You do not have permission to edit this commission.'});
0 commit comments