Set Permission for Particular Role

Topics: Administration, General
Feb 18, 2014 at 10:45 AM
below is the code for AdminMenu, i need to set "My Courses" item to only visible or accessible by Authenticated Users whereas first two Menu items should be visible or accessible by only Moderators .
using Orchard.Environment;
using Orchard.Localization;
using Orchard.Security;
using Orchard.UI.Navigation;
using System.Web.Routing;

namespace Orchard.Club
{
    public class AdminMenu : INavigationProvider
    {
        private readonly Work<RequestContext> _requestContextAccessor;

        public string MenuName
        {
            get { return "admin"; }
        }

        public AdminMenu(Work<RequestContext> requestContextAccessor)
        {
            _requestContextAccessor = requestContextAccessor;
            T = NullLocalizer.Instance;
        }
 

        public AdminMenu()
        {
            T = NullLocalizer.Instance;
        }

        private Localizer T { get; set; }

        public void GetNavigation(NavigationBuilder builder)
        {
            // "Webshop"
            builder.Add(item => item

                .Caption(T("Courses"))
                .Position("2")
                .Action("Index", "CourseAdmin", new { area = "Orchard.Club" })
                .Permission(StandardPermissions.SiteOwner)
            );

            // "Webshop"
            builder.Add(item => item
                .Caption(T("Members"))
                .Position("3")
                .Action("Index", "CustomerAdmin", new { area = "Orchard.Club" })
                .Permission(StandardPermissions.SiteOwner)
            );
            // "Webshop"
            builder.Add(item => item

                .Caption(T("My Courses"))
                .Position("2")
                .Action("Index", "Member", new { area = "Orchard.Club" })
            );
        }
    }
}