This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
// Assembly Reference Used: OfficeDevPnP.Core, Version=2.4.1605.0, Culture=neutral, PublicKeyToken=3751622786b357c2 | |
//Supports: SharePoint Online, SharePoint 2013+ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.SharePoint.Client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowRevertFromTemplate (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function disablePageCustomizationAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
//The below line helps to disables the page customization access | |
oSite.set_allowRevertFromTemplate(flase); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowRevertFromTemplate (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function enablePageCustomizationAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
//The below line helps to enables the page customization access | |
oSite.set_allowRevertFromTemplate(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowRevertFromTemplate (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function getPageCustomizationAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
clientContext.load(oSite); | |
clientContext.executeQueryAsync( | |
Function.createDelegate(this, function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowMasterPageEditing (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function disableMasterPageAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
//The below line helps to disable the master page access | |
oSite.set_allowMasterPageEditing(flase); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowMasterPageEditing (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function enableMasterPageAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
//The below line helps to enables the master page access | |
oSite.set_allowMasterPageEditing(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowMasterPageEditing (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function getMasterPageAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
clientContext.load(oSite); | |
clientContext.executeQueryAsync( | |
Function.createDelegate(this, function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowDesigner (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function disableSiteDesignerAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
//The below line helps to disable the designer access | |
oSite.set_allowDesigner(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//Property used: SP.Site.allowDesigner (sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function enableSiteDesignerAccess() { | |
var clientContext = new SP.ClientContext(); | |
oSite = clientContext.get_site(); | |
//The below line helps to enable the designer access | |
oSite.set_allowDesigner(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Author: Shantha Kumar T | |
//set_title() and get_description() properties used to set the title and description to the list respectively | |
//get_title() and get_description() properties used to get the title and description to the list respectively | |
//Property used: SP.List.title and SP.List.description(sp.js) | |
//Supports SharePoint 2010 + and SharePoint Online | |
function UpdatelistTitle(listTitle) { | |
var clientContext = new SP.ClientContext(); | |
oList = clientContext.get_web().get_lists().getByTitle(listTitle); | |
oList.set_title('New List Title'); |