Auktorisering > Moduler

Auktorisering

Logga in på den här applikationen med hjälp av på de fördefinierade användarna i listan nedan och gå tillbaka till den här sidan och klicka på följande plattor som simulerar CRM-moduler för att kontrollera om du är behörig att komma åt dem eller inte baserat på behörigheterna för den loggade i användarnamn.!

Användarnamn Lista!

Användarnamn Lösenord Roller
admin@example.com admin Users, Roles and Groups
alan.rose@example.com user CRM, Audit (Sales and Accounting Modules)
catherine.bell@example.com user All Modules in CRM
george.winter@example.com user CRM, Sales Module
james.cruz@example.com user CRM, Support Module
mark.davis@example.com user CRM, Marketing Module
philip.gonzalez@example.com user CRM, Accounting Module
william.lake@example.com user CRM, Operations Module

Organisationsstruktur

Implementering

namespace CRM.Web.Controllers
{
        [LocalizedAuthorize(Roles = "CRM")]
        public class AuthorizationTestController : BaseController
    {
        #region Public Methods
        // GET: AuthorizationTest
        public ActionResult Index()
        {
        return View();
        }

        // GET: AuthorizationTest/Sales
        [LocalizedAuthorize(Roles = "CEO,Audit,Sales")]
        public ActionResult Sales()
        {
        return View();
        }

        // GET: AuthorizationTest/Marketing
        [LocalizedAuthorize(Roles = "CEO,Marketing")]
        public ActionResult Marketing()
        {
        return View();
        }

        // GET: AuthorizationTest/Accounting
        [LocalizedAuthorize(Roles = "CEO,Audit,Accounting")]
        public ActionResult Accounting()
        {
        return View();
        }

        // GET: AuthorizationTest/Operations
        [LocalizedAuthorize(Roles = "CEO,Operations")]
        public ActionResult Operations()
        {
        return View();
        }

        // GET: AuthorizationTest/Support
        [LocalizedAuthorize(Roles = "CEO,Support")]
        public ActionResult Support()
        {
        return View();
        }
        #endregion Public Methods
    }
}