locked
Authorization RRS feed

  • Question

  • User1600840720 posted

    Hi Everyone,

    I am new to MVC I have been trying to Make a student MIS in MV5, I have three roles Admin, Teachers and students. Admin can create Course, Batch and Subjects, User with the teachers role can add the students to a Batch of a particular course and users with the students role can only view. So far I have achieved this by using role based authorization.

    My question is, when the Admin create a subject of a particular course I would like the admin to assign a teacher who will only have the permission to update the student attendance of that particular subject. Do I have to use claim base authorization? Or how do I solve this.

    Your help and guidance is highly appreciated.

    Tuesday, November 6, 2018 10:35 AM

All replies

  • User1080785583 posted

    I have done this with claim based authorization and was able to add claims such as "Teacher" to a user account. The claim of "Teacher" allows you to add claims such as "Subject" that you can then manage by giving a "Student" a claim to a "Subject".  I would absorb as much as you can around claims before you write any code. Meaning, download examples, run working code, download bad examples, good examples, mvc, webforms, web api, and the likes and decide which you appreciate. 

    Tuesday, November 6, 2018 3:44 PM
  • User1520731567 posted

    HI Moa,

    Moa

    My question is, when the Admin create a subject of a particular course I would like the admin to assign a teacher who will only have the permission to update the student attendance of that particular subject. Do I have to use claim base authorization? Or how do I solve this.

    I think you need Database Design,for example:

    Create a table named Authorization,it contains Id,AdminID, teacherID,CourseID,SubjectsID,CreateTime,UpdateTime...

    When an admin assign a teacher,this table will add a new record.

    You could do CURD to this table based on your need.

    Best Regards.

    Yuki Tao

    Wednesday, November 7, 2018 7:23 AM
  • User1600840720 posted

    Thank you for the reply

    Thursday, November 8, 2018 5:34 AM