Thursday, April 23, 2015

Check current user exists in a group using an AJAX call

    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getByName('Site Members')/Users?         $filter=Id eq " + _spPageContextInfo.userId,
    type: "GET",
    cache: true,
    async: false,
        "ACCEPT": "application/json;odata=verbose"
    success: function (data) {
  if (data.d.results[0] != undefined) {
        //user is a member
    error: function () {

No comments:

Post a Comment

How to launch a document by clicking a link to the file?

Word: <a href='ms-word:ofe|u|path/to/web/word/document.docx'>Link to document</a> Excel: <a href='ms-excel:o...