public INetworkGuestRepository GetNetworkGuestRepository() { if (_networkGuestRepository == null) { _networkGuestRepository = GetRepository(x => x.GetNetworkGuestRepository()); } return(_networkGuestRepository); }
public INetworkGuestRepository GetNetworkGuestRepository() { if (_networkGuestRepository == null) { var networkRepository = GetNetworkRepositoryWithoutGuests(); var userRepository = GetRepository(x => x.GetUserRepository()); _networkGuestRepository = new NetworkGuestRepository(_connection, networkRepository, userRepository); } return(_networkGuestRepository); }
public static void Copy(this INetworkGuestRepository repository, Network source, Network destination) { var users = repository.Get(source); foreach (var user in users) { if (!repository.Check(destination, user)) { repository.Add(destination, user); } } }
public static void AddUserAndCopyAccess(IUserRepository userRepository, INetworkRepository networkRepository, INetworkGuestRepository networkGuestRepository, string username, string password, string referenceUsername) { var user = User.Create(string.Join(":", "internal", username)); user.Secret = Web.Persistence.Helpers.Secrets.BCryptSecret.FromPassword(password); userRepository.Add(user); var referenceUser = userRepository.Get(string.Join(":", "internal", referenceUsername)); var networks = networkRepository.Get(referenceUser); foreach (var network in networks) { networkGuestRepository.Add(network, user); } }
public GuestEnabledDeviceRepository(IDeviceRepository devices, INetworkGuestRepository guests) { _devices = devices; _guests = guests; }
public GuestEnabledNetworkRepository(INetworkRepository networks, INetworkGuestRepository guests) { _networks = networks; _guests = guests; }