feat(permissions): add dashboard.view permission for cashier/counter/workshop
This commit is contained in:
@@ -53,7 +53,8 @@ window.renderSidebar = function(modulesOverride) {
|
||||
'invoicing.view': 'invoicing',
|
||||
'quotations.view': 'quotations',
|
||||
'accounting.view': 'accounting',
|
||||
'reports.view': 'reports'
|
||||
'reports.view': 'reports',
|
||||
'dashboard.view': 'dashboard'
|
||||
};
|
||||
for (var p in permMap) {
|
||||
if (perms.indexOf(p) !== -1 && allowed.indexOf(permMap[p]) === -1) {
|
||||
@@ -63,10 +64,14 @@ window.renderSidebar = function(modulesOverride) {
|
||||
return allowed.indexOf(id) !== -1;
|
||||
}
|
||||
if (role === 'counter') {
|
||||
return ['pos','catalog','inventory','customers','workshop','remission_notes','reports'].indexOf(id) !== -1;
|
||||
var allowed = ['pos','catalog','inventory','customers','workshop','remission_notes','reports'];
|
||||
if (hasPerm('dashboard.view')) allowed.push('dashboard');
|
||||
return allowed.indexOf(id) !== -1;
|
||||
}
|
||||
if (role === 'cashier') {
|
||||
return ['pos','catalog','inventory','customers','workshop','remission_notes','invoicing','reports'].indexOf(id) !== -1;
|
||||
var allowed = ['pos','catalog','inventory','customers','workshop','remission_notes','invoicing','reports'];
|
||||
if (hasPerm('dashboard.view')) allowed.push('dashboard');
|
||||
return allowed.indexOf(id) !== -1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user