Example #1
0
 /// <summary>
 /// create new instance of filter based on course authorization
 /// </summary>
 /// <param name="entityType">type of the entity</param>
 /// <param name="entityIdFieldName">name of the field with entity id within HTTP route</param>
 /// <param name="courseReferenceServiceFactory"></param>
 public CourseBasedAuthorizeFilter(EntityType entityType, string entityIdFieldName,
                                   ICourseReferenceServiceFactory courseReferenceServiceFactory)
 {
     this.entityType = entityType;
     this.courseReferenceServiceFactory = courseReferenceServiceFactory;
     this.entityIdFieldName             = entityIdFieldName;
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="entityType">type of the course-related entity</param>
 /// <param name="entityIdFieldName">name of the field with entity id within HTTP route</param>
 /// <param name="peopleService"></param>
 /// <param name="courseMemberService"></param>
 /// <param name="courseReferenceServiceFactory"></param>
 /// <param name="courseMemberReferenceServiceFactory"></param>
 public CourseAdminOrOwnerAuthorizeFilter(EntityType entityType, string entityIdFieldName,
                                          [FromServices] IPeopleService peopleService, [FromServices] ICourseMemberService courseMemberService,
                                          [FromServices] ICourseReferenceServiceFactory courseReferenceServiceFactory,
                                          [FromServices] ICourseMemberReferenceServiceFactory courseMemberReferenceServiceFactory)
     : base(entityType, entityIdFieldName, courseReferenceServiceFactory)
 {
     this.peopleService       = peopleService;
     this.courseMemberService = courseMemberService;
     this.courseMemberReferenceServiceFactory = courseMemberReferenceServiceFactory;
 }
Example #3
0
 /// <summary>
 /// create new filter authorizing admin of a course
 /// </summary>
 /// <param name="entityType">type of the course-related entity</param>
 /// <param name="entityIdFieldName">name of the field with entity id within HTTP route</param>
 /// <param name="peopleService"></param>
 /// <param name="courseReferenceServiceFactory"></param>
 public CourseAdminAuthorizeFilter(EntityType entityType, string entityIdFieldName,
                                   [FromServices] IPeopleService peopleService, [FromServices] ICourseReferenceServiceFactory courseReferenceServiceFactory)
     : base(entityType, entityIdFieldName, courseReferenceServiceFactory)
 {
     this.peopleService = peopleService;
 }