0

I have a current logged in User Id and through JQuery I want to find that whether the User Id is in site collection admins or not.

 $().SPServices({
   operation: "GetUserInfo",
   userLoginName: $().SPServices.SPGetCurrentUser(),
   completefunc: function(xData, Status) {
   console.log$(xData.responseXML).find("User").attr("IsSiteAdmin"))
   }
});

I have used above code but for the normal users its not working.

Thanks.

2 Answers 2

0

isSiteAdmin gets you Site Admin info, not Site Collection

This might be easier:

_spPageContextInfo.isSiteAdmin
0

You can use the following code to check whether current user is site admin or not.

var user = SP.ClientContext.get_web().get_currentUser();

var value = user.get_isSiteAdmin ();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.