Managed reflection does not reveal that particular attribute.  I believe
that this is documented some where in the Partition II MetaData.doc.
The PermView.exe command line utility can see it but that is using
unmanaged code.

-----Original Message-----
From: The DOTNET list will be retired 7/1/02
[mailto:[EMAIL PROTECTED]] On Behalf Of Mindaugas Zilinskas
Sent: Wednesday, June 05, 2002 4:37 AM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Ways to get security info

I need to find information on class security permissions without
creating instance of it.

But following code results  only one attribute :(

Call method :
     foreach( object atr in typeof( SecTest).GetCustomAttributes( true )
)
     {
       System.Diagnostics.Trace.WriteLine( atr.GetType().FullName,
t.FullName );
     }
Result :
    TestSecurity.SecTest: System.ComponentModel.DescriptionAttribute

Helper and SecTest classes :
using System;
using System.Security.Permissions;
namespace TestSecurity
{
  [System.ComponentModel.Description("Some test class for security")]
// OK I see tihs atribute
  [PrincipalPermission( SecurityAction.Demand, Role="Test")] // this one
is hidden :(
  public class SecTest
  {}

}


Mindaugas

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to