My list called "WorkFlowTempDocLib" has Read permission for group called
siteGroupNamePublisher="Publisher";
SPList yourList = site.Lists["WorkFlowTempDocLib"];
SPGroup secGroupCertifier = site.SiteGroups[siteGroupNameCertifier];
yourList.BreakRoleInheritance(true);
SPRoleAssignment roleAssignment3 = new SPRoleAssignment(secGroupCertifier);
SPRoleDefinition roleDefinition3 = site.RoleDefinitions.GetByType(SPRoleType.Contributor);
roleAssignment3.RoleDefinitionBindings.Add(roleDefinition3);
yourList.RoleAssignments.Add(roleAssignment3);
yourList.Update();
Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts
Wednesday, July 2, 2008
Tuesday, July 1, 2008
Adding Links to QuickLaunchBar....

Sample Lists.xml

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
//Begin--Adding a Link to QuickLaunchBar....
ABCConfig config = new ABCConfig();
SPWeb site = (SPWeb)properties.Feature.Parent;
SPWeb rootsite = site.Site.RootWeb;
SPNavigationNodeCollection navColl = site.Navigation.QuickLaunch;
SPNavigationNode navNode = new SPNavigationNode("Submissions", "");
navColl.AddAsFirst(navNode);
//Read name and urls from the xml file
XmlDocument doc = new XmlDocument();
string ListOperationXMLPath = config.GetConfigValue(rootsite, "ABCLinks");
doc.Load(ListOperationXMLPath);
XmlNodeList lists = doc.GetElementsByTagName("Link");
foreach (XmlNode node1 in lists)
{
XmlElement fieldElement = (XmlElement)node1;
string FieldNameTitle = "";
string xmlUrl = "";
string siteUrl = "";
if (fieldElement.HasAttributes)
{
FieldNameTitle = fieldElement.Attributes["Title"].InnerText;
xmlUrl = fieldElement.Attributes["Url"].InnerText;
siteUrl = "/" + site.Title + "/"+xmlUrl;
SPNavigationNode node = new SPNavigationNode(FieldNameTitle, siteUrl);
foreach (SPNavigationNode nodes in site.Navigation.QuickLaunch)
{
if (nodes.Title.Equals("Submissions", StringComparison.InvariantCultureIgnoreCase))
{
nodes.Children.AddAsLast(node);
break;
}
}
}
}
Subscribe to:
Comments (Atom)
