Skip to content

Commit

Permalink
Fix #8
Browse files Browse the repository at this point in the history
Cambio en el manejo de permisos, de escritura/eliminación a control total.
  • Loading branch information
VitaBh committed Sep 12, 2022
1 parent 921cbd0 commit 58192a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BlockTheSpot/BlockTheSpot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<SupportUrl>https://github.com/bitasuperactive/BlockTheSpot-C-Sharp/</SupportUrl>
<ProductName>BlockTheSpot-C-Sharp</ProductName>
<PublisherName>bitasuperactive</PublisherName>
<ApplicationRevision>35</ApplicationRevision>
<ApplicationRevision>36</ApplicationRevision>
<ApplicationVersion>2.2.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down
8 changes: 4 additions & 4 deletions BlockTheSpot/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public partial class BlockTheSpot : Form
/// </summary>
public BlockTheSpot()
{
CheckIfAlreadyRunning();
InitializeComponent();
CheckIfAlreadyRunning();
}


Expand Down Expand Up @@ -544,8 +544,8 @@ private void DownloadCompleted()
this.toolTip.SetToolTip(this.outputLabel, "");
}
/// <summary>
/// Maneja el control de acceso para el directorio "Update" de Spotify,
/// permitiéndo o negando los permisos de escritura y eliminación.
/// Maneja el control de acceso para el directorio "Update" de Spotify, el cual crea si no existe,
/// permitiéndo o negando todos los permisos de acceso.
/// </summary>
/// <param name="controlType">Tipo de acceso a implementar (permitir/denegar).</param>
private void FileSecurity(AccessControlType controlType)
Expand All @@ -562,7 +562,7 @@ private void FileSecurity(AccessControlType controlType)
foreach (FileSystemAccessRule rule in dirSecurity.GetAccessRules(true, true, typeof(NTAccount)))
dirSecurity.RemoveAccessRule(rule);

dirSecurity.AddAccessRule(new FileSystemAccessRule(WindowsIdentity.GetCurrent().Name, FileSystemRights.Write | FileSystemRights.Delete, controlType));
dirSecurity.AddAccessRule(new FileSystemAccessRule(WindowsIdentity.GetCurrent().Name, FileSystemRights.FullControl, controlType));

Directory.SetAccessControl(dir, dirSecurity);
}
Expand Down

0 comments on commit 58192a5

Please sign in to comment.