JSOM: get_isSiteAdmin () is not distinguishing between users and administrator of site collection

154 views Asked by At
   if (user.get_isSiteAdmin()) 
    {
    document.cookie = "licence=yes";
    }

I am using user.get_isSiteAdmin() but its always giving value false I can not give permission to site site collection

Site Collection - Full Control 

in AppMenifest.xml file

is there any other way to get site administrator ?

1

There are 1 answers

3
Baker_Kong On

@user11869887,

Just have a test this JSOM function on my SPO environment, it works fine here. enter image description here

you may need to explicitly initialize the object/properties, or it will always return false as the related property is null.

BR