SharePoint 2010 / 2013 Get all groups for SPUser including active directory group

SharePoint don't give you groups for SPUser if the right is given by an active directory group.You have to merge groups specificied directly using user login in sharepoint groups and active directory groups.private static List GetAllUserGroups(SPUser user){    List groups = new List();    //Get groups from SharePoint    foreach (SPGroup spGroup in user.Groups)    … Continue reading SharePoint 2010 / 2013 Get all groups for SPUser including active directory group

How to activate custom action based on SharePoint Right

This javascript function is a helper to enable or disable custom action for SharePoint 2010 based on ContentTypeID, Permissions and number of selected element.You can call this function in the CommandUIHandler EnabledScript attributeCreate a custom action for Ribbon :  <CustomAction Id="Ribbon.AlertPerso"              RegistrationType="ContentType"                … Continue reading How to activate custom action based on SharePoint Right