Skip to content

Instantly share code, notes, and snippets.

@KingsSync
KingsSync / dynamics_365_user_security_roles.js
Last active November 10, 2025 15:43
Dynamics 365 User Security Role Bookmarklet
javascript: (() => { function loadData(useCache) { var cached = useCache ?%20sessionStorage.getItem(%27D365_UserRoles_Cache%27)%20:%20null;%20var%20timestamp%20=%20useCache%20?%20sessionStorage.getItem(%27D365_UserRoles_Cache_Timestamp%27)%20:%20null;%20if%20(cached%20&&%20timestamp)%20{%20var%20age%20=%20Date.now()%20-%20parseInt(timestamp);%20if%20(age%20%3C%2030%20*%2060%20*%201000)%20{%20displayData(JSON.parse(cached),%20true);%20return;%20}%20}%20var%20spinner%20=%20document.createElement(%27div%27);%20spinner.style.cssText%20=%20%27position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);z-index:10000;display:flex;align-items:center;justify-content:center;flex-direction:column%27;%20var%20spinnerCircle%20=%20document.createElement(%27div%27);%20spinnerCircle.style.cssText%20=%20%27border:8px%20solid%20#f3f3f3;border-top:8px%20solid%20#0078d4;border-radius:50%;width:60px;height:60px;animation:spin%201s%20linear%20infinite';%20var%20style%20=%20document.createElement('style');%20style