Widget: DataExporter: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 12: Line 12:
             const permittedUsers = ['Eschmidt'];
             const permittedUsers = ['Eschmidt'];


             const output = document.getElementById('output');
              
 
             async function exportData() {
             async function exportData() {
                 const usrData = await fetch(usr).then(rsp => rsp.json());
                 const usrData = await fetch(usr).then(rsp => rsp.json());
                 const usrName = usrData?.query?.userinfo?.name;
                 const usrName = usrData?.query?.userinfo?.name;
 
               
                const output = document.getElementById('output');
               
                 if (!permittedUsers.includes(usrName)) {
                 if (!permittedUsers.includes(usrName)) {
                     output.innerHTML = '<span style="color:red; font-size:large">Access Denied</span>';
                     output.innerHTML = '<span style="color:red; font-size:large">Access Denied</span>';

Revision as of 12:03, 15 August 2023