Declaritive security attribute help!

  • Thread starter Ray Cassick \(Home\)
  • Start date
R

Ray Cassick \(Home\)

I am trying to tag an assembly with a minimum requirements check so that it
will know if it has the ability to read and write to a specific folder.

The problem is that the specific folder is a sub folder of the users
ApplicationData folder.

Anyone have any examples of how to do this? I have been looking in the help
and Googling for the last few hours and can't seem to find an example of
this.

I set up a small test project that uses the following line to check before
it draws the main form:

<Assembly:
Security.Permissions.FileIOPermission(Security.Permissions.SecurityAction.RequestMinimum,
All:=Nothing, Append:=Nothing, PathDiscovery:=Nothing, Read:="C:\Documents
and Settings\rcassick\Application Data\Enterprocity", Unrestricted:=False,
Write:="C:\Documents and Settings\rcassick\Application Data\Enterprocity")>

and then I ran it from an account that I KNOW has no ability to read or
write form that path and it did not seem to do anything at all. I was
expecting at least to get some Security Exception window.


--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/
 
R

Ray Cassick \(Home\)

Is there a way though to use a path that changes depending on the logged on
user and still do this declaratively? I don't think so.

The path I am after in as user specific Application Data path.

I don't think I can do this declaratively.
 

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

Top