In this blog, we are going to learn how to check the permission of the user on the list. Some times we need to show and hide several things as per the permission assigned to the user. SharePoint has different permission levels. We are using the function of "sp.js", to use function of sp.js we need to include the sp.js file. In this example, we are checking for the delete permission. SP . SOD.executeFunc('sp.js', 'SP.ClientContext', function () { checkPermssion(); }); function checkPermssion(){ var web,clientContext,currentUser,oList; clientContext = new SP.ClientContext.get_current(); web = clientContext.get_web(); currentUser = web.get_currentUser(); oList = web.get_lists().getByTitle(' List Title'); clientContext.load(oList,'EffectiveBasePermissions'); clientContext.load(currentUser); clientContext.load(web); clientContext.executeQueryAsync(function(){ if (oList....
Techrobbers provides information related to Modern SharePoint, SharePoint Online, SharePoint Framework, Power Automate, PowerShell, PnP, Microsoft Teams and other things which are related to Microsoft 365.