changes.mady.by.user Joel Ponce
Saved on Sep 24, 2021
changes.mady.by.user Me Me Mon
Saved on Feb 17, 2022
...
<a class="edit-btn" id="edit-profile-btn"> <button> Edit Profile</button></a> <a class="edit-btn" id="edit-picture-btn"> <button> Edit Profile Picture</button></a> <script>
const getCurrentUserGroups = async () => { let res = await jQuery.ajax({ url: "/rest/api/user/memberof?username=" + AJS.params.remoteUser, type: "get", dataType: 'json', async: true }).then(res => res); res = res.results; let groupNames = []; for(var i = 0; i < res.length; i++){ groupNames.push(res[i].name); } return groupNames; } let companyName = new URLSearchParams(window.location.search).get("company"); const companyMember = `morganstanley-${companyName}-users`; getCurrentUserGroups().then((groups) => { if (groups.includes("confluence-administrators") || groups.includes("morganstanley-admins") || groups.includes(companyMember)) { Â Â Â document.getElementById('edit-profile-btn').href = `/display/MSCOM/Edit+Company+Profile?username=${param_name}`; document.getElementById('edit-picture-btn').href = `/display/MSCOM/Edit+Profile+Picture?username=${param_name}`; Â Â Â document.getElementById('edit-profile-btn').display = "initial"; document.getElementById('edit-picture-btn').display = "initial"; } else { Â Â Â document.getElementById('edit-profile-btn').display = "none"; document.getElementById('edit-picture-btn').
display =
"none"; } }) </script>
<img src="" class="service-banner hide-on-mobile">
-