Permissions/Protection

  • Thread starter Thread starter ShieldsJared
  • Start date Start date
S

ShieldsJared

So I recently developed an C# application to be ran by quite a few
people from a shared drive. The application is stored in say:
"ROOT". The program accesses files within say "ROOT\BIN". Is there a
way to allow the program access to this folder, but prevent users from
being abel to access it and view the files directly?

Thanks a lot!!
 
So I recently developed an C# application to be ran by quite a few
people from a shared drive. The application is stored in say:
"ROOT". The program accesses files within say "ROOT\BIN". Is there a
way to allow the program access to this folder, but prevent users from
being abel to access it and view the files directly?

You could create a User specifically for accessing those files, and grant
permissions on the folder only to that user. Your program would impersonate
that user before accessing the files. Obviously, you keep the password for
that internal user secret from everyone except the program that needs to
impersonate the user.
Code to impersonate a user is available at multiple locations, for
instance, here:
http://www.codeproject.com/useritems/User_Impersonation_in_Ne.asp
 
No, there isn't. Programs themselves have no identity, and therefore,
can't have permissions that are granted to them. The program runs under the
user's identity, and what they can do, the program can do.

.NET security will apply a reduction in permissions depending on other
factors, but the reverse can not be applied. You can not have an elevation
of privledges.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top