Skip to content

Instantly share code, notes, and snippets.

@mrbarletta
Created March 16, 2020 04:22
Show Gist options
  • Save mrbarletta/03cbf2eb20226a32efa2dbed02d7e597 to your computer and use it in GitHub Desktop.
Save mrbarletta/03cbf2eb20226a32efa2dbed02d7e597 to your computer and use it in GitHub Desktop.
Mass update SuiteCRM roles using JS - adjust the value, paste on console and Save
let a= $("[id^=ACLEditView_Access] [id$=delete]").each(function(i, item){
let el = $(item).find('select')
if(el.length>0){
$("#"+$(el).attr('id')+" option[value='80']").prop('selected',true) // 80 means GROUP
}
})
let a= $("[id^=ACLEditView_Access] [id$=edit]").each(function(i, item){
let el = $(item).find('select')
if(el.length>0){
$("#"+$(el).attr('id')+" option[value='80']").prop('selected',true) // 80 means GROUP
}
})
let a= $("[id^=ACLEditView_Access] [id$=list]").each(function(i, item){
let el = $(item).find('select')
if(el.length>0){
$("#"+$(el).attr('id')+" option[value='80']").prop('selected',true) // 80 means GROUP
}
})
let a= $("[id^=ACLEditView_Access] [id$=view]").each(function(i, item){
let el = $(item).find('select')
if(el.length>0){
$("#"+$(el).attr('id')+" option[value='80']").prop('selected',true) // 80 means GROUP
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment