fixed permissions
This commit is contained in:
parent
a4f454faa0
commit
428929b1f7
@ -79,10 +79,13 @@ erpnext.desktop.render = function() {
|
||||
|
||||
for(var i in wn.boot.modules_list) {
|
||||
var m = wn.boot.modules_list[i];
|
||||
if(m!='Setup')
|
||||
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1)
|
||||
add_icon(m);
|
||||
}
|
||||
|
||||
if(user_roles.indexOf('Accounts Manager')!=-1)
|
||||
add_icon('Dashboard')
|
||||
|
||||
if(user_roles.indexOf('System Manager')!=-1)
|
||||
add_icon('Setup')
|
||||
|
||||
|
@ -87,7 +87,7 @@ erpnext.toolbar.add_modules = function() {
|
||||
for(var i in wn.boot.modules_list) {
|
||||
var m = wn.boot.modules_list[i]
|
||||
|
||||
if(m!='Setup') {
|
||||
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) {
|
||||
args = {
|
||||
module: m,
|
||||
module_page: erpnext.modules[m],
|
||||
@ -98,6 +98,12 @@ erpnext.toolbar.add_modules = function() {
|
||||
data-module="%(module)s">%(module_label)s</a></li>', args));
|
||||
}
|
||||
}
|
||||
|
||||
// dasboard for accounts system manager
|
||||
if(user_roles.indexOf("Accounts Manager")!=-1) {
|
||||
$('.navbar .modules').append('<li><a href="#!dashboard" \
|
||||
data-module="Dashboard">Dashboard</a></li>');
|
||||
}
|
||||
|
||||
// setup for system manager
|
||||
if(user_roles.indexOf("System Manager")!=-1) {
|
||||
|
@ -34,7 +34,8 @@ erpnext.modules = {
|
||||
'To Do': 'todo',
|
||||
'Calendar': 'calendar',
|
||||
'Messages': 'messages',
|
||||
'Knowledge Base': 'questions'
|
||||
'Knowledge Base': 'questions',
|
||||
'Dashboard': 'dashboard'
|
||||
}
|
||||
|
||||
erpnext.startup.set_globals = function() {
|
||||
@ -59,6 +60,10 @@ erpnext.startup.start = function() {
|
||||
wn.title_prefix = wn.boot.website_settings.title_prefix;
|
||||
}
|
||||
} else {
|
||||
// always allow apps
|
||||
wn.boot.profile.allow_modules = wn.boot.profile.allow_modules.concat(
|
||||
['To Do', 'Knowledge Base', 'Calendar', 'Activity'])
|
||||
|
||||
// setup toolbar
|
||||
erpnext.toolbar.setup();
|
||||
|
||||
|
@ -2229,12 +2229,13 @@ wn.modules_path='erpnext';wn.settings.no_history=true;$(document).bind('ready',f
|
||||
/*
|
||||
* erpnext/startup/startup.js
|
||||
*/
|
||||
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions'}
|
||||
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions','Dashboard':'dashboard'}
|
||||
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
|
||||
if(inList(user_roles,'System Manager'))is_system_manager=1;}
|
||||
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
|
||||
if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);}
|
||||
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
|
||||
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity'])
|
||||
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
|
||||
Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
|
||||
$('#startup_div').toggle(false);}
|
||||
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
|
||||
@ -2282,9 +2283,11 @@ erpnext.toolbar.add_modules=function(){$('<li class="dropdown">\
|
||||
</li>').prependTo('.navbar .nav:first');if(wn.boot.modules_list)
|
||||
wn.boot.modules_list=JSON.parse(wn.boot.modules_list);else
|
||||
wn.boot.modules_list=keys(erpnext.modules).sort();for(var i in wn.boot.modules_list){var m=wn.boot.modules_list[i]
|
||||
if(m!='Setup'){args={module:m,module_page:erpnext.modules[m],module_label:m=='HR'?'Human Resources':m}
|
||||
if(m!='Setup'&&wn.boot.profile.allow_modules.indexOf(m)!=-1){args={module:m,module_page:erpnext.modules[m],module_label:m=='HR'?'Human Resources':m}
|
||||
$('.navbar .modules').append(repl('<li><a href="#!%(module_page)s" \
|
||||
data-module="%(module)s">%(module_label)s</a></li>',args));}}
|
||||
if(user_roles.indexOf("Accounts Manager")!=-1){$('.navbar .modules').append('<li><a href="#!dashboard" \
|
||||
data-module="Dashboard">Dashboard</a></li>');}
|
||||
if(user_roles.indexOf("System Manager")!=-1){$('.navbar .modules').append('<li class="divider"></li>\
|
||||
<li><a href="#!Setup" data-module="Setup">Setup</a></li>');}}
|
||||
/*
|
||||
|
@ -1077,12 +1077,13 @@ wn.modules_path='erpnext';wn.settings.no_history=true;$(document).bind('ready',f
|
||||
/*
|
||||
* erpnext/startup/startup.js
|
||||
*/
|
||||
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions'}
|
||||
var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions','Dashboard':'dashboard'}
|
||||
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
|
||||
if(inList(user_roles,'System Manager'))is_system_manager=1;}
|
||||
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
|
||||
if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);}
|
||||
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
|
||||
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity'])
|
||||
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
|
||||
Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
|
||||
$('#startup_div').toggle(false);}
|
||||
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
|
||||
|
@ -1 +1 @@
|
||||
774
|
||||
776
|
Loading…
x
Reference in New Issue
Block a user