Posts

Showing posts with the label Sharepoint

Sharepoint - Utils in JS

Functions to help to configurations in JS Get user login info    function getWebUserData() {         var context = new SP.ClientContext.get_current();         var web = context.get_web();         var currentUser = web.get_currentUser(); var loginName = currentUser.get_loginName(); console.log(loginName);     }     ExecuteOrDelayUntilScriptLoaded(getWebUserData(), "sp.js"); Get if user has permissions to read SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () { // function to get if user as permission to edit list function getCurrentUserPermission() {  var web,clientContext,currentUser,oList,perMask; clientContext = new SP.ClientContext.get_current(); web = clientContext.get_web(); currentUser = web.get_currentUser();  oList = web.get_lists().getByTitle('InfoSuporte'); clientContext.load(oList,'EffectiveBasePermissions');...