Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Files In Folders the User Does Not Have Permission to View

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I have a program that opens what I call external files. These are files in a folder that pertain to individual invoices or orders. They are named like: 1234.pdf, 1234.tif, 5678.xls, 5678.xls, 5678.txt. Up till now I have just display a list of the files for one invoice or order on the screen and let the user pick which file they would like to view. I then use the following code (short version) to open the file in the windows default program.
Code:
Dim psInfo As New System.Diagnostics.ProcessStartInfo(FullFileName)
psInfo.WindowStyle = ProcessWindowStyle.Normal
myProcess1 = System.Diagnostics.Process.Start(psInfo)
This works well. Now the client wants to prevent the sales people from possible opening other salesman files. I currently only let the salesman see there invoices/orders. So the problem is not in the list of files presented to the user, but rather in the "file open" open options in the windows programs such as notepad, etc. that would let then navigate to other files. To help solve this on the server we have removed access to these folders for all salesman. I have tried to start a process as a different user that has permission to these folders, but some of the programs need permission to copy the file before it is displayed, and that permision seems to go back to the original user (salesman). Can somebody provide some guidance? maybe you have done something like this. I tried some other code for impersonation, but that didn't work either.

Auguy
Sylvania/Toledo Ohio
 
A few questions for you, for the sake of clarification

1) What permission method are you using to give/deny access to files? (Operating system set?)
2) Are the files on the local computer, where the application runs from, or are they stored on a remote computer?
3) If on a remote computer, what operating system are you using there?

The reason I am asking is that I had something similar at some point. The files were stored on a Linux system, and the permissions to rwx were set on the server, first on a folder level, then in some cases, on individual files. When attempting to open a file, either via the application, or via file/open in notepad, for example, the linux server granted or denied access. So I'm not clear on which setup you have.



Cheers,

Realm174
 
1. At the OS level, Win Server 2012 at the folder level.
2. No, on Win Server 2012.
3. Win Server 2012.


Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top