Esempio n. 1
0
 public UserSearcher(UlearnDb db, IAccessRestrictor accessRestrictor, IEnumerable <ISearcher> searchers, IEnumerable <IFilter> filters)
 {
     this.db = db;
     this.accessRestrictor = accessRestrictor;
     this.searchers        = searchers.ToList();
     this.filters          = filters.ToList();
 }
Esempio n. 2
0
        protected AbstractSearcherForInstructors(
            IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IAccessRestrictor accessRestrictor,
            bool hasSystemAdministratorAccess, bool hasCourseAdminAccess, bool hasInstructorAccessToGroupMembers, bool hasInstructorAccessToCourseInstructors,
            SearchField searchField
            )
        {
            this.usersRepo        = usersRepo;
            this.courseRolesRepo  = courseRolesRepo;
            this.accessRestrictor = accessRestrictor;

            this.hasSystemAdministratorAccess           = hasSystemAdministratorAccess;
            this.hasCourseAdminAccess                   = hasCourseAdminAccess;
            this.hasInstructorAccessToGroupMembers      = hasInstructorAccessToGroupMembers;
            this.hasInstructorAccessToCourseInstructors = hasInstructorAccessToCourseInstructors;

            this.searchField = searchField;
        }
Esempio n. 3
0
        public AbstractSearcherForInstructors(
            IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IAccessRestrictor accessRestrictor,
            bool hasSystemAdministratorAccess, bool hasCourseAdminAccess, bool hasInstructorAccessToGroupMembers, bool hasInstructorAccessToCourseInstructors,
            SearchField searchField,
            params Expression <Func <ApplicationUser, string> >[] userProperties
            )
        {
            if (userProperties.Length == 0)
            {
                throw new ArgumentException("UserProperties should be specified", nameof(userProperties));
            }

            this.usersRepo        = usersRepo;
            this.courseRolesRepo  = courseRolesRepo;
            this.accessRestrictor = accessRestrictor;

            this.hasSystemAdministratorAccess           = hasSystemAdministratorAccess;
            this.hasCourseAdminAccess                   = hasCourseAdminAccess;
            this.hasInstructorAccessToGroupMembers      = hasInstructorAccessToGroupMembers;
            this.hasInstructorAccessToCourseInstructors = hasInstructorAccessToCourseInstructors;

            this.searchField    = searchField;
            this.userProperties = userProperties;
        }
Esempio n. 4
0
 public SearcherByNames(IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IAccessRestrictor accessRestrictor)
     : base(usersRepo, courseRolesRepo, accessRestrictor,
            true, true, true, true,
            SearchField.Name,
            u => u.FirstName, u => u.LastName
            )
 {
 }
Esempio n. 5
0
 public SearcherByLogin(IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IAccessRestrictor accessRestrictor)
     : base(usersRepo, courseRolesRepo, accessRestrictor,
            true, true, true, true,
            SearchField.Login
            )
 {
 }
Esempio n. 6
0
 public SearcherBySocialLogin(IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IAccessRestrictor accessRestrictor)
 {
     this.usersRepo        = usersRepo;
     this.courseRolesRepo  = courseRolesRepo;
     this.accessRestrictor = accessRestrictor;
 }
Esempio n. 7
0
 public SearcherByEmail(IUsersRepo usersRepo, ICourseRolesRepo courseRolesRepo, IAccessRestrictor accessRestrictor)
     : base(usersRepo, courseRolesRepo, accessRestrictor,
            true, true, true, false,
            SearchField.Email,
            u => u.Email
            )
 {
 }