CAESDO.Recruitment.Web.Shared_ApplicationReview.Page_Init C# (CSharp) Метод

Page_Init() защищенный Метод

Page_Init checks to ensure that the query string is valid, the logged in user is an admin or equivalent, the given application is valid
protected Page_Init ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        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);
        }