Ejemplo n.º 1
0
        public override void AddUsersToRoles(string[] usernames, string[] rolenames)
        {
            foreach (string rolename in rolenames)
            {
                RoleGuardClauses(rolename, true);
            }

            foreach (string username in usernames)
            {
                UserGuardClauses(username);
                foreach (string rolename in rolenames)
                {
                    if (IsUserInRole(username, rolename))
                    {
                        throw new ProviderException("User is already in role.");
                    }
                }
            }
            _memberRepo.AddUsersToRoles(usernames.ToList(), rolenames.ToList(), ApplicationName);
        }