/// -----------------------------------------------------------------------------
        /// <summary>
        /// BindPermissions binds the permissions checkbox list
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	01/23/2007 Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void BindPermissions(bool test)
        {
            PermissionsValid = true;

            lstPermissions.Items.Clear();
            var permissionItem = new ListItem();
            var verifier = new FileSystemPermissionVerifier(Server.MapPath("~"));

            //FolderCreate
            if (test)
            {
                permissionItem.Selected = verifier.VerifyFolderCreate();
                PermissionsValid = PermissionsValid && permissionItem.Selected;
            }
            permissionItem.Enabled = false;
            permissionItem.Text = LocalizeString("FolderCreate");
            lstPermissions.Items.Add(permissionItem);

            //FileCreate
            permissionItem = new ListItem();
            if (test)
            {
                permissionItem.Selected = verifier.VerifyFileCreate();
                PermissionsValid = PermissionsValid && permissionItem.Selected;
            }
            permissionItem.Enabled = false;
            permissionItem.Text = LocalizeString("FileCreate");
            lstPermissions.Items.Add(permissionItem);

            //FileDelete
            permissionItem = new ListItem();
            if (test)
            {
                permissionItem.Selected = verifier.VerifyFileDelete();
                PermissionsValid = PermissionsValid && permissionItem.Selected;
            }
            permissionItem.Enabled = false;
            permissionItem.Text = LocalizeString("FileDelete");
            lstPermissions.Items.Add(permissionItem);

            //FolderDelete
            permissionItem = new ListItem();
            if (test)
            {
                permissionItem.Selected = verifier.VerifyFolderDelete();
                PermissionsValid = PermissionsValid && permissionItem.Selected;
            }
            permissionItem.Enabled = false;
            permissionItem.Text = LocalizeString("FolderDelete");
            lstPermissions.Items.Add(permissionItem);
            if (test)
            {
                lblPermissionsError.Text = PermissionsValid ? LocalizeString("PermissionsOk") : LocalizeString("PermissionsError").Replace("{0}", Globals.ApplicationMapPath);
            }
        }
        private bool CheckPermissions()
        {
            bool verified = new FileSystemPermissionVerifier(Server.MapPath("~")).VerifyAll();
            HtmlUtils.WriteFeedback(HttpContext.Current.Response,
                                    0,
                                    "Checking File and Folder permissions " + (verified ? "<font color='green'>Success</font>" : "<font color='red'>Error</font>") + "<br>");
            Response.Flush();

            return verified;
        }
Esempio n. 3
0
        private bool CheckPermissions()
        {
            bool verified = new FileSystemPermissionVerifier(Server.MapPath("~")).VerifyAll();
            HtmlUtils.WriteFeedback(HttpContext.Current.Response,
                                    0,
                                    "بررسي دسترسي هاي فايل و پوشه " + (verified ? "<font color='green'>موفقيت آميز</font>" : "<font color='red'>خطا</font>") + "<br/>");
            Response.Flush();

            return verified;
        }