var tabPermissionController = new TabPermissionController(); var hasAccess = tabPermissionController.HasTabPermission(Context.User, "Content Editor", "Presentation");
var user = Sitecore.Security.Accounts.User.FromName("sitecore/John", false); var tabPermissionController = new TabPermissionController(); var hasAccess = tabPermissionController.HasTabPermission(user, "Content Editor", "Publishing Restrictions");In this example, we create a new Sitecore user object for a user named John and pass it to the HasTabPermission method along with the names of the Content Editor and Publishing Restrictions tabs. This will return true if John has access to the Publishing Restrictions tab and false otherwise. Package library: Sitecore.Kernel.dll.