Posts

Showing posts with the label Sharepoint Groups

SharePoint 2010: JavaScript Code To Check if user exists in a group (ECMA)

//Call this function where you want IsCurrentUserMemberOfGroup( "GropuName" , function (isCurrentUserInGroup) { if (!isCurrentUserInGroup) { } }); //Below is the Function to Check whether the user exists in the group or not function IsCurrentUserMemberOfGroup(strGroupName, functionComplete) { //Setup Vars currentContext = null ; currentWeb = null ; allGroups = null ; leaderGroup = null ; currentUser = null ; groupUsers = null ; //Get an instance of the Client Content. currentContext = new SP.ClientContext.get_current(); //Grab the client web object. currentWeb = currentContext.get_web(); //Get the current user object currentUser = currentContext.get_web().get_currentUser(); currentContext.load(currentUse...

Add multiple target audience groups to SharePoint Quick Launch Node

private void SetAdminViewAudience(SPNavigationNode node)         {             if (quickLaunchItem.Properties.Contains("Audience"))             {                 node.Properties["Audience"] = ";;;;" + Group1+","+ Group2 +","+ Group3+","+etc... "";             }             else             {                               node.Properties.Add("Audience",  ";;;;" + Group1+","+ Group2 +","+ Group3+","+etc... "" );             }             node.Update();         }