/// <summary>
 /// Add all users with the given userids to the database with the given roles, the roles are only added
 /// to any roles already on the user account never removed. This makes it safe to call even if the user
 /// already exists.
 /// </summary>
 /// <param name="repo">The repository.</param>
 /// <param name="users">The users.</param>
 /// <param name="roles">The roles.</param>
 public static async Task AddUsers(this IUserEntityRepository repo, IEnumerable <User> users, IEnumerable <String> roles)
 {
     foreach (var user in users)
     {
         await repo.AddUser(user, roles);
     }
 }
Beispiel #2
0
 public ServiceDescription_UserService(IEventDispatcher eventDispatcher,
                                       IServiceDescription_UserEntityRepository serviceDescription_UserRepository,
                                       IUserEntityRepository userRepository)
 {
     _eventDispatcher = eventDispatcher;
     _serviceDescription_UserRepository = serviceDescription_UserRepository;
     _userRepository = userRepository;
 }
Beispiel #3
0
 public UserService(IUserEntityRepository userRepository,
                    IServiceDescription_UserEntityRepository serviceDescription_UserRepository,
                    IResetPasswordEntityRepository resetPasswordRepository,
                    IEventDispatcher eventDispatcher)
 {
     _userRepository = userRepository;
     _serviceDescription_UserRepository = serviceDescription_UserRepository;
     _resetPasswordRepository           = resetPasswordRepository;
     _eventDispatcher = eventDispatcher;
 }
 public Ontology_UserService(IEventDispatcher eventDispatcher,
                             IOntology_UserEntityRepository ontology_UserRepository,
                             IUserEntityRepository userRepository,
                             IServiceDescription_UserEntityRepository serviceDescription_UserEntityRepository,
                             IServiceDescription_OntologyEntityRepository serviceDescription_OntologyEntityRepository,
                             IOntologyTermEntityRepository ontologyTermEntityRepository)
 {
     _eventDispatcher         = eventDispatcher;
     _ontology_UserRepository = ontology_UserRepository;
     _userRepository          = userRepository;
     _serviceDescription_UserEntityRepository     = serviceDescription_UserEntityRepository;
     _serviceDescription_OntologyEntityRepository = serviceDescription_OntologyEntityRepository;
     _ontologyTermEntityRepository = ontologyTermEntityRepository;
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="eventDispatcher"></param>
 /// <param name="shareInvitationRepository"></param>
 /// <param name="userRepository"></param>
 /// <param name="serviceDescription_UserRepository"></param>
 /// <param name="serviceDescription_OntologyRepository"></param>
 /// <param name="serviceDescriptionRepository"></param>
 /// <param name="graphService"></param>
 /// <param name="shareInvitation_OntologyRepository"></param>
 public ShareInvitationService(IEventDispatcher eventDispatcher,
                               IShareInvitationEntityRepository shareInvitationRepository,
                               IUserEntityRepository userRepository,
                               IServiceDescription_UserEntityRepository serviceDescription_UserRepository,
                               IServiceDescription_OntologyEntityRepository serviceDescription_OntologyRepository,
                               IServiceDescriptionEntityRepository serviceDescriptionRepository,
                               IGraphService graphService,
                               IShareInvitation_OntologyEntityRepository shareInvitation_OntologyRepository)
 {
     _eventDispatcher                       = eventDispatcher;
     _shareInvitationRepository             = shareInvitationRepository;
     _userRepository                        = userRepository;
     _serviceDescription_UserRepository     = serviceDescription_UserRepository;
     _serviceDescription_OntologyRepository = serviceDescription_OntologyRepository;
     _serviceDescriptionRepository          = serviceDescriptionRepository;
     _graphService = graphService;
     _shareInvitation_OntologyRepository = shareInvitation_OntologyRepository;
 }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserService"/> class.
        /// </summary>
        /// <param name="Repository">User Repository</param>
        /// <param name="FileService">File Service</param>
        /// <param name="LoggerService">Logger Service</param>
        public UserService(
            IUserEntityRepository Repository,
            IFileService FileService,
            ILoggerService LoggerService)
        {
            if (Repository == null)
            {
                throw new NullReferenceException("User Service Repository Null");
            }

            if (FileService == null)
            {
                throw new NullReferenceException("File Service Null");
            }

            if (LoggerService == null)
            {
                throw new NullReferenceException("Logger Service Null");
            }

            this._repository = Repository;
            this._fileservice = FileService;
            this._loggerservice = LoggerService;
        }
Beispiel #7
0
 public UserService(IUserEntityRepository userEntityRepository)
 {
     _userEntityRepository = userEntityRepository;
 }
 public UserService(IUserEntityRepository repository)
 {
     _repository = repository;
 }
 /// <summary>
 /// Add a user with the given userid to the database with the given roles, the roles are only added
 /// to any roles already on the user account never removed. This makes it safe to call even if the user
 /// already exists.
 /// </summary>
 /// <param name="repo">The repository.</param>
 /// <param name="user">The user.</param>
 /// <param name="roles">The roles.</param>
 public static Task AddUser(this IUserEntityRepository repo, User user, IEnumerable <String> roles)
 {
     return(repo.AddUser(user, roles));
 }
 /// <summary>
 /// Add multiple admins. See AddAdmin for more info.
 /// </summary>
 /// <param name="repo"></param>
 /// <param name="users"></param>
 /// <param name="roles"></param>
 public static Task AddAdmins(this IUserEntityRepository repo, IEnumerable <User> users, IEnumerable <String> roles)
 {
     return(AddUsers(repo, users, roles.Concat(AuthorizationAdminRoles.All())));
 }
Beispiel #11
0
 public RoleManager(IUserEntityRepository userRepo, IAdminRoleProvider adminRoles)
 {
     this.userRepo   = userRepo;
     this.adminRoles = adminRoles;
 }