Example #1
0
 public ReportController(FacsalDbContext dbContext)
 {
     DbContext = dbContext;
     int.TryParse(ConfigurationManager.AppSettings["CycleYear"], out CycleYear);
 }
 public ReportFileController(FacsalDbContext dbContext)
 {
     DbContext = dbContext;
     UserRoles = Roles.GetRolesForUser().ToList<string>();
 }
Example #3
0
        public IList<string> GetStoredUserRoles()
        {
            FacsalDbContext DbContext = new FacsalDbContext();

            var roles = DbContext.RoleAssignments
                .Where(ra => ra.User.Pid == CasAuthentication.CurrentPrincipal.Identity.Name)
                .Select(ra => ra.Role.Name)
                .ToList<string>();

            if (roles != null)
            {
                return roles;
            }

            return EMPTY_LIST;
        }