Exemplo n.º 1
0
        protected void CreateRolesAndUsersForTask()
        {
            var roles = new [] { "Employees", "USA", "Managers", "Ukraine", "Developers", "Main Office" };

            roles.ForEach(role => IdentityRepository.AddRole(role));
            IdentityRepository.AddChildrenRoles("Employees", new List <string> {
                "USA", "Managers", "Ukraine", "Developers"
            });
            IdentityRepository.AddChildrenRoles("Ukraine", new List <string> {
                "Main Office"
            });
            IdentityRepository.AddChildrenRoles("Developers", new List <string> {
                "Main Office"
            });

            CreateUserForTask("O. Cole", "*****@*****.**");
            CreateUserForTask("J. Shane", "*****@*****.**");
            CreateUserForTask("V. Petrov", "*****@*****.**");
            CreateUserForTask("M. Popov", "*****@*****.**");

            IdentityRepository.AddUserInRoles("O. Cole", new [] { "USA" });
            IdentityRepository.AddUserInRoles("J. Shane", new[] { "USA", "Managers" });
            IdentityRepository.AddUserInRoles("V. Petrov", new[] { "Main Office" });
            IdentityRepository.AddUserInRoles("M. Popov", new[] { "Main Office" });
        }