예제 #1
0
            public void Dispose()
            {
                if (this.isUsingAppContainer)
                {
                    AppContainerProtection appContainerProtection = serviceProvider.GetService <AppContainerProtection>();

                    Console.WriteLine(
                        "Removing access for AppContainer '{0}' from directory '{1}'",
                        appContainerProtection.AppContainer.SecurityIdentifier,
                        Environment.CurrentDirectory);
                    Process
                    .Start(
                        "icacls.exe",
                        $"{Environment.CurrentDirectory} /remove *{appContainerProtection.AppContainer.SecurityIdentifier}")
                    .WaitForExit();
                }
            }
예제 #2
0
            public AppContainerPermissionScope(Parameters parameters, IServiceProvider serviceProvider)
            {
                this.isUsingAppContainer = parameters.AppContainer;
                this.serviceProvider     = serviceProvider;

                if (this.isUsingAppContainer)
                {
                    AppContainerProtection appContainerProtection = serviceProvider.GetService <AppContainerProtection>();

                    Console.WriteLine(
                        "Assigning access to AppContainer '{0}' for directory '{1}'",
                        appContainerProtection.AppContainer.SecurityIdentifier,
                        Environment.CurrentDirectory);
                    Process
                    .Start(
                        "icacls.exe",
                        $"{Environment.CurrentDirectory} /grant *{appContainerProtection.AppContainer.SecurityIdentifier}:(OI)(CI)(F)")
                    .WaitForExit();
                }
            }