コード例 #1
0
 public override string[] GetRolesForUser(string username)
 {
     if (AdminRequestHandler.SelectByLogin(username) != null)
     {
         return(new string[] { "ADMIN" });
     }
     else if (EmployerRequestHandler.SelectByLogin(username) != null)
     {
         return(new string[] { "EMPLOYER" });
     }
     else if (EmployeeRequestHandler.SelectByLogin(username) != null)
     {
         return(new string[] { "EMPLOYEE" });
     }
     return(new string[] { });
 }
コード例 #2
0
 public override bool IsUserInRole(string username, string roleName)
 {
     return(AdminRequestHandler.CheckRole(username, roleName) ||
            EmployerRequestHandler.CheckRole(username, roleName) ||
            EmployeeRequestHandler.CheckRole(username, roleName));
 }