Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _spBodyOnLoadFunctionNames.push("loadPage"); //ensure the core.js is loaded onto the page before executing
- function loadPage() {
- var call = jQuery.ajax({
- url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/currentuser/issiteadmin",
- type: "GET",
- datatype:"json",
- headers: { Accept: "application/json;odata=verbose" }
- });
- call.done(function(data) {
- var isSiteAdmin = data.d.IsSiteAdmin;
- checkActiveUser(isSiteAdmin);
- });
- }
- function checkActiveUser(isAdmin) {
- if (!isAdmin)
- $("input[id$='id of control without GUID']").css('display', 'none');
- //or $("input[id$='id of control without GUID']").hide();
- //your css to hide the control here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement