Showing posts with label permission. Show all posts
Showing posts with label permission. Show all posts

Friday, February 12, 2016

Hide Ribbons to the anonymous users?


Hide Ribbons to the anonymous users in SharePoint based on the PermissionsString ......

<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server"
        PermissionsString="AddListItems" AuthenticationRestrictions="AuthenticatedUsersOnly">
     
 <script type="text/javascript">
            document.getElementById("s4-ribbonrow").style.display = "block";
            document.getElementById("suiteBar").style.display = "block";
     
        </script>

    </SharePoint:SPSecurityTrimmedControl>

Wednesday, December 9, 2015

Programmatically Create SharePoint Toplink bar and Quicklaunch bar in SharePoint 2010 and 2013

Programmatically Create TopLink Bar in SharePoint site collection:

SPNavigationNodeCollection topnav = oweb.Navigation.TopNavigationBar;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();


Similarly, To create Quicklaunch bar

SPNavigationNodeCollection topnav = oweb.Navigation.QuickLaunch;
SPNavigationNode node = new SPNavigationNode("Title", "URL");
node = topnav.AddAsLast(node);
node.Update();

Thursday, April 30, 2015

Removing the BreakRoleInheritance permission list or library using Powershell


Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#testname
$list = (Get-SPWeb "http://spserver/2015/").Lists["testname"]
$list.BreakRoleInheritance($true,$true)
$list.Update()