Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. _spBodyOnLoadFunctionNames.push("loadPage"); //ensure the core.js is loaded onto the page before executing
  2.  
  3. function loadPage() {
  4. var call = jQuery.ajax({
  5. url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/currentuser/issiteadmin",
  6. type: "GET",
  7. datatype:"json",
  8. headers: { Accept: "application/json;odata=verbose" }
  9. });
  10. call.done(function(data) {
  11. var isSiteAdmin = data.d.IsSiteAdmin;
  12. checkActiveUser(isSiteAdmin);
  13. });
  14. }
  15. function checkActiveUser(isAdmin) {
  16. if (!isAdmin)
  17. $("input[id$='id of control without GUID']").css('display', 'none');
  18. //or $("input[id$='id of control without GUID']").hide();
  19. //your css to hide the control here
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement