protected void Page_Init(object sender, EventArgs e)
{
if (currentApplication == null)
{
//if the current application does not have a database association, redirect to an error page
Response.Redirect(RecruitmentConfiguration.ErrorPage(RecruitmentConfiguration.ErrorType.UNKNOWN));
}
if (AdministrativeAccess) //Only allow in administrative access
{
//Check User Permissions if the user isn't an admin
if (!Roles.IsUserInRole("Admin"))
{
if (PositionBLL.VerifyPositionAccess(currentApplication.AppliedPosition) == false)
{
//If the user does not have position access, redirect to the not authorized page
Response.Redirect(RecruitmentConfiguration.ErrorPage(RecruitmentConfiguration.ErrorType.AUTH));
}
}
}
else //Use committee rules
{
bool allowedAccess = false;
bool reviewerAccess = false;
CommitteeMemberBLL.CheckAccess(currentApplication.AppliedPosition, out allowedAccess, out reviewerAccess);
if (!allowedAccess)
{
Response.Redirect(RecruitmentConfiguration.ErrorPage(RecruitmentConfiguration.ErrorType.AUTH));
}
if (reviewerAccess)
gviewReferences.Columns[INT_REFERENCE_FILE_COLUMN].Visible = false;
}
//Trace.Write("Valid user and application " + currentApplication.ID.ToString() + Environment.NewLine);
}