コード例 #1
0
        private void Apply_CAIRS_Page_Access_Security()
        {
            //Current Page
            string current_page_name = Path.GetFileName(Request.Path);

            //need to append addition string before comparing to match correctly.
            string prefix = "/Pages/";

            current_page_name = prefix + current_page_name;

            ListItem liCurrentPage = liPagesToIgnoreSecurity().FindByValue(current_page_name);

            //Ignore the page if they are in the list of pages to ignore security
            //if user does not have access
            if (!AppSecurity.hasAccess() && !liPagesToIgnoreSecurity().Contains(liCurrentPage))
            {
                Unauthorized_Access("");
            }
            else
            {
                //Don't allow access to page
                Apply_CAIRS_To_Pages();
            }
        }