ScientificReport
UserProfileRole.cs
Go to the documentation of this file.
1 using System;
2 using Microsoft.AspNetCore.Identity;
3 
4 namespace ScientificReport.DAL.Roles
5 {
6  public sealed class UserProfileRole : IdentityRole<Guid>
7  {
8  public const string Teacher = "Teacher";
9  public const string HeadOfDepartment = "HeadOfDepartment";
10  public const string Administrator = "Administrator";
11 
12  // Allows all roles except anonymous users
13  public const string Any = Teacher + "," + HeadOfDepartment + "," + Administrator;
14 
15  // Allows only head of department or administrator
16  public const string HeadOfDepartmentOrAdmin = HeadOfDepartment + "," + Administrator;
17 
18  public static readonly string[] Roles =
19  {
20  Teacher, HeadOfDepartment, Administrator
21  };
22 
23  public UserProfileRole(string name)
24  {
25  Name = name;
26  }
27  }
28 }