function userSecurity(){
                return {
                    kind: 'panel.form',
                    name: 'securitySettings',
                    title: 'Security Settings',
                    // action: '#!',
                    // action: '/xapi/users/' + data.username + '/roles',
                    // action: '/data/user/' + data.username + '/roles',
                    // _action: '/app/action/ModifyUserGroups',
                    contents: {
                        systemRolesSubhead: {
                            kind: 'panel.subhead',
                            label: 'System Roles'
                        },
                        csrfToken: {
                            kind: 'input.hidden',
                            name: 'XNAT_CSRF',
                            value: csrfToken
                        },
                        siteManager: {
                            kind: 'panel.input.switchbox',
                            label: 'Site Manager',
                            id: 'custom-role-administrator',
                            name: 'custom_role',
                            value: 'Administrator',
                            element: {
                                checked: (data.roles.indexOf('Administrator') > -1)
                            },
                            description: '<p>This allows users to access the Administrative pages of the web interface.</p>' +
                            '<div class="warning">' +
                            '<b>WARNING:</b> Granting administrative privileges allows this user great power ' +
                            'over the entire site.' +
                            '</div>'
                        },
                        nonExpiring: {
                            kind: 'panel.input.switchbox',
                            label: 'Non-Expiring',
                            id: 'custom-role-non-expiring',
                            name: 'custom_role',
                            value: 'non_expiring',
                            element: {
                                checked: (data.roles.indexOf('non_expiring') > -1)
                            },
                            description: '<p>This prevents this accounts password from expiring.</p>' +
                            '<div class="warning">' +
                            '<b>WARNING:</b> Granting a user account a non-expiring password is a security risk ' +
                            'and should be limited to accounts that perform automated system tasks. In addition, ' +
                            'if any users are designated as non-expiring access to the user list should be ' +
                            'restricted to administrators.' +
                            '</div>'
                        },
                        allDataSubhead: {
                            kind: 'panel.subhead',
                            label: 'Allow All Data Access'
                        },
                        allDataRadios: {
                            tag: 'div.all-data-radios',
                            contents: {
                                noRadio: {
                                    kind: 'input.radio',
                                    id: 'data_none',
                                    name: 'xdat:user.groups.groupID[0].groupID',
                                    label: 'No',
                                    value: 'NULL'//,
                                    // afterElement: 'No'
                                },
                                readOnlyRadio: {
                                    kind: 'input.radio',
                                    id: 'data_access',
                                    name: 'xdat:user.groups.groupID[0].groupID',
                                    label: 'Read Only',
                                    value: 'ALL_DATA_ACCESS'
                                },
                                readEditDeleteRadio: {
                                    kind: 'input.radio',
                                    id: 'data_admin',
                                    name: 'xdat:user.groups.groupID[0].groupID',
                                    label: 'Read, Edit, Delete',
                                    value: 'ALL_DATA_ADMIN'
                                }
                            }
                        },
                        allDataWarning: {
                            tag: 'div.warning',
                            content: 'WARNING: Allowing full access to data will allow this user to see ALL data ' +
                            'stored in this system. It supersedes project membership. Most accounts on your server ' +
                            'should NOT have All Data Access allowed.'
                        }
                    }
                }
            }
// TODO: replace old 'advanced' security settings with this
replace old 'advanced' security settings with this
replace old ' advanced ' security settings with this
function userSecurity(){
                return {
                    kind: 'panel.form',
                    name: 'securitySettings',
                    title: 'Security Settings',
                    contents: {
                        systemRolesSubhead: {
                            kind: 'panel.subhead',
                            label: 'System Roles'
                        },
                        csrfToken: {
                            kind: 'input.hidden',
                            name: 'XNAT_CSRF',
                            value: csrfToken
                        },
                        siteManager: {
                            kind: 'panel.input.switchbox',
                            label: 'Site Manager',
                            id: 'custom-role-administrator',
                            name: 'custom_role',
                            value: 'Administrator',
                            element: {
                                checked: (data.roles.indexOf('Administrator') > -1)
                            },
                            description: '<p>This allows users to access the Administrative pages of the web interface.</p>' +
                            '<div class="warning">' +
                            '<b>WARNING:</b> Granting administrative privileges allows this user great power ' +
                            'over the entire site.' +
                            '</div>'
                        },
                        nonExpiring: {
                            kind: 'panel.input.switchbox',
                            label: 'Non-Expiring',
                            id: 'custom-role-non-expiring',
                            name: 'custom_role',
                            value: 'non_expiring',
                            element: {
                                checked: (data.roles.indexOf('non_expiring') > -1)
                            },
                            description: '<p>This prevents this accounts password from expiring.</p>' +
                            '<div class="warning">' +
                            '<b>WARNING:</b> Granting a user account a non-expiring password is a security risk ' +
                            'and should be limited to accounts that perform automated system tasks. In addition, ' +
                            'if any users are designated as non-expiring access to the user list should be ' +
                            'restricted to administrators.' +
                            '</div>'
                        },
                        allDataSubhead: {
                            kind: 'panel.subhead',
                            label: 'Allow All Data Access'
                        },
                        allDataRadios: {
                            tag: 'div.all-data-radios',
                            contents: {
                                noRadio: {
                                    kind: 'input.radio',
                                    id: 'data_none',
                                    name: 'xdat:user.groups.groupID[0].groupID',
                                    label: 'No',
                                    value: 'NULL'
                                },
                                readOnlyRadio: {
                                    kind: 'input.radio',
                                    id: 'data_access',
                                    name: 'xdat:user.groups.groupID[0].groupID',
                                    label: 'Read Only',
                                    value: 'ALL_DATA_ACCESS'
                                },
                                readEditDeleteRadio: {
                                    kind: 'input.radio',
                                    id: 'data_admin',
                                    name: 'xdat:user.groups.groupID[0].groupID',
                                    label: 'Read, Edit, Delete',
                                    value: 'ALL_DATA_ADMIN'
                                }
                            }
                        },
                        allDataWarning: {
                            tag: 'div.warning',
                            content: 'WARNING: Allowing full access to data will allow this user to see ALL data ' +
                            'stored in this system. It supersedes project membership. Most accounts on your server ' +
                            'should NOT have All Data Access allowed.'
                        }
                    }
                }
            }
function userSecurity ( ) { return { kind : 'panel.form' , name : 'securitySettings' , title : 'Security Settings' , contents : { systemRolesSubhead : { kind : 'panel.subhead' , label : 'System Roles' } , csrfToken : { kind : 'input.hidden' , name : 'XNAT_CSRF' , value : csrfToken } , siteManager : { kind : 'panel.input.switchbox' , label : 'Site Manager' , id : 'custom-role-administrator' , name : 'custom_role' , value : 'Administrator' , element : { checked : ( data . roles . indexOf ( 'Administrator' ) > - 1 ) } , description : '<p>This allows users to access the Administrative pages of the web interface.</p>' + '<div class="warning">' + '<b>WARNING:</b> Granting administrative privileges allows this user great power ' + 'over the entire site.' + '</div>' } , nonExpiring : { kind : 'panel.input.switchbox' , label : 'Non-Expiring' , id : 'custom-role-non-expiring' , name : 'custom_role' , value : 'non_expiring' , element : { checked : ( data . roles . indexOf ( 'non_expiring' ) > - 1 ) } , description : '<p>This prevents this accounts password from expiring.</p>' + '<div class="warning">' + '<b>WARNING:</b> Granting a user account a non-expiring password is a security risk ' + 'and should be limited to accounts that perform automated system tasks. In addition, ' + 'if any users are designated as non-expiring access to the user list should be ' + 'restricted to administrators.' + '</div>' } , allDataSubhead : { kind : 'panel.subhead' , label : 'Allow All Data Access' } , allDataRadios : { tag : 'div.all-data-radios' , contents : { noRadio : { kind : 'input.radio' , id : 'data_none' , name : 'xdat:user.groups.groupID[0].groupID' , label : 'No' , value : 'NULL' } , readOnlyRadio : { kind : 'input.radio' , id : 'data_access' , name : 'xdat:user.groups.groupID[0].groupID' , label : 'Read Only' , value : 'ALL_DATA_ACCESS' } , readEditDeleteRadio : { kind : 'input.radio' , id : 'data_admin' , name : 'xdat:user.groups.groupID[0].groupID' , label : 'Read, Edit, Delete' , value : 'ALL_DATA_ADMIN' } } } , allDataWarning : { tag : 'div.warning' , content : 'WARNING: Allowing full access to data will allow this user to see ALL data ' + 'stored in this system. It supersedes project membership. Most accounts on your server ' + 'should NOT have All Data Access allowed.' } } } }
TODO: replace old 'advanced' security settings with this
TODO : replace old ' advanced ' security settings with this
// action: '#!', // action: '/xapi/users/' + data.username + '/roles', // action: '/data/user/' + data.username + '/roles', // _action: '/app/action/ModifyUserGroups', //, // afterElement: 'No'