I am so close, but feel I have something wrong. I want to hide the accordion for all but a select group of users. The user that is currently logged in and viewing the form - not a People Picker field.
I have done this globally, but to narrow the scope, I am not sure what I am missing.
//This shows or hides Staff Accordion based on specific logged-in users
fd.spRendered(function() {
var currentUserLoginName=_spPageContextInfo.userLoginName;
function enableOrDisableAccordionTabs() {if ('user@outlook.com' || 'user@mywork.com' || 'user@gmail.com' || 'user@flmae.net' || 'user@pilot.org' || 'karrot@pickle.com' || 'user$pizza.edu' == currentUserLoginName) {
// Enable Staff Only Accordion fd.container('Accordion2').$children[0].disabled = false; } else { // Disable Staff Only Accordion fd.container('Accordion2').$children[0].disabled = true; } } // Calling enableOrDisableAccordionTabs on form loading enableOrDisableAccordionTabs();
});