Seshadri M

Seshadri M

  • NA
  • 69
  • 18.1k

Need to create roles in Authorization in C#

Sep 25 2017 2:28 AM

Student Access the Exam grades

Staff can access student Exam grades
 
SuperAdmin can access ( CRUD on Exam  grades).
 
 In web config.
<authentication mode="window">
</authentication> 
<authorization>
<allow roles="Student,Staff,SuperAdmin"/>
<deny user="*"/>
</authorization>
 
// I need to created the Student, staff,SuperAdmin
 
 
in Code behind page
 
if( User.IsInRole("Student"))
{
// Access the exam grades 
 else if( User.IsInRole("Staff"))
{
// Access the student grades
}
 else if( User.IsInRole ("SuperAdmin"))
{
//Access for insert,update, delete of Exam grades  
 
 
 
 I need to created role of Student, Staff, SuperAdmin

Answers (2)