public DoGetAction(IActivityIOPath path) { _logOnProvider = new LogonProvider(); _fileWrapper = new FileWrapper(); _path = path; ImpersonatedUser = ValidateAuthorization.RequiresAuth(_path, _logOnProvider); }
public DoGetAction(IActivityIOPath path, IDev2LogonProvider dev2LogonProvider, IFile fileWrapper, ImpersonationDelegate impersonationDelegate) : base(impersonationDelegate) { _logOnProvider = dev2LogonProvider; _fileWrapper = fileWrapper; _path = path; _impersonatedUser = _impersonationDelegate(_path, _logOnProvider); }
public DoDeleteOperation(IDeleteHelper deleteHelper, IActivityIOPath path, IDev2LogonProvider logOnProvider, ImpersonationDelegate impersonationDelegate) : base(impersonationDelegate) { _deleteHelper = deleteHelper; _path = path; _logOnProvider = logOnProvider; _impersonatedUser = _impersonationDelegate?.Invoke(_path, _logOnProvider); }
public DoPathExistOperation(IActivityIOPath path, IDev2LogonProvider dev2LogonProvider, IFile fileWrapper, IDirectory directory, ImpersonationDelegate impersonationDelegate) : base(impersonationDelegate) { _logOnProvider = dev2LogonProvider; _fileWrapper = fileWrapper; _dirWrapper = directory; _path = path; _impersonatedUser = _impersonationDelegate(_path, _logOnProvider); }
public DoCreateDirectory(IActivityIOPath path, IDev2CRUDOperationTO args) { _logOnProvider = new LogonProvider(); _fileWrapper = new FileWrapper(); _dirWrapper = new DirectoryWrapper(); _path = path; _crudArguments = args; ImpersonatedUser = ValidateAuthorization.RequiresAuth(_path, _logOnProvider); _handleOverwrite = RequiresOverwrite(_crudArguments, _path, _logOnProvider); }
public DoGetFilesAsPerTypeOperation(IActivityIOPath path, ReadTypes type) { _logOnProvider = new LogonProvider(); _fileWrapper = new FileWrapper(); _dirWrapper = new DirectoryWrapper(); _path = path; _type = type; ImpersonatedUser = ValidateAuthorization.RequiresAuth(_path, _logOnProvider); _newPath = AppendBackSlashes(_path, _fileWrapper, _dirWrapper); }
public DoCreateDirectory(IActivityIOPath path, IDev2CRUDOperationTO args, IDev2LogonProvider dev2LogonProvider, IFile fileWrapper, IDirectory directory, ImpersonationDelegate impersonationDelegate) : base(impersonationDelegate) { _logOnProvider = dev2LogonProvider; _fileWrapper = fileWrapper; _dirWrapper = directory; _path = path; _crudArguments = args; _impersonatedUser = _impersonationDelegate(_path, _logOnProvider); _handleOverwrite = RequiresOverwrite(_crudArguments, _path, _logOnProvider); }
public DoGetFilesAsPerTypeOperation(IActivityIOPath path, ReadTypes type, IDev2LogonProvider dev2LogonProvider, IFile file, IDirectory directory, ImpersonationDelegate impersonationDelegate) : base(impersonationDelegate) { _logOnProvider = dev2LogonProvider; _fileWrapper = file; _dirWrapper = directory; _path = path; _type = type; _impersonatedUser = _impersonationDelegate(_path, _logOnProvider); _newPath = AppendBackSlashes(_path, _fileWrapper, _dirWrapper); }
public DoPutAction(Stream currentStream, IActivityIOPath destination, IDev2CRUDOperationTO crudArgument, string whereToPut) { _logOnProvider = new LogonProvider(); _pathWrapper = new FilePathWrapper(); _fileWrapper = new FileWrapper(); _currentStream = currentStream; Destination = destination; _arguments = crudArgument; ImpersonatedUser = ValidateAuthorization.RequiresAuth(Destination, _logOnProvider); _whereToPut = whereToPut; }
public DoPutAction(Stream currentStream, IActivityIOPath destination, IDev2CRUDOperationTO crudArgument, string whereToPut, IDev2LogonProvider logOnProvider, IFile fileWrapper, IFilePath pathWrapper, ImpersonationDelegate impersonationDelegate) : base(impersonationDelegate) { _logOnProvider = logOnProvider; _pathWrapper = pathWrapper; _fileWrapper = fileWrapper; _currentStream = currentStream; _destination = destination; _arguments = crudArgument; _impersonatedUser = _impersonationDelegate(_destination, _logOnProvider); _whereToPut = whereToPut; }
public static WindowsImpersonationContext RequiresAuth(IActivityIOPath path, IDev2LogonProvider dev2LogonProvider) { var safeToken = string.IsNullOrEmpty(path.Username) ? null : DoLogOn(dev2LogonProvider, path); if (safeToken != null) { using (safeToken) { var newID = new WindowsIdentity(safeToken.DangerousGetHandle()); return(newID.Impersonate()); } } return(null); }
public static DoDeleteOperation RequiresOverwrite(IDev2CRUDOperationTO arg, IActivityIOPath path, IDev2LogonProvider dev2LogonProvider) => arg.Overwrite ? new DoDeleteOperation(path, dev2LogonProvider) : null;
public static SafeTokenHandle DoLogOn(IDev2LogonProvider dev2Logon, IActivityIOPath path) => dev2Logon.DoLogon(path);
public DoDeleteOperation(IDeleteHelper deleteHelper, IActivityIOPath path, IDev2LogonProvider logOnProvider) : this(deleteHelper, path, logOnProvider, null) { }
public DoDeleteOperation(IActivityIOPath path, IDev2LogonProvider logOnProvider) : this(new DeleteHelper(new FileWrapper(), new DirectoryWrapper()), path, logOnProvider) { }
public DoDeleteOperation(IActivityIOPath path, IDev2LogonProvider logOnProvider) { _logOnProvider = logOnProvider; _path = path; }