none
PermCalc RRS feed

  • Question

  • Hi all

    I get this xml from using PermCalc :

    <IPermission version="1" class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Flags="UnmanagedCode, ControlThread, ControlEvidence, RemotingConfiguration" />
    
    
    Now, how can I combine these flages together (use | or &) ?

    I using this code :
    [assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.UnmanagedCode &  SecurityPermissionFlag.RemotingConfiguration &
    
                                                    SecurityPermissionFlag.ControlEvidence & SecurityPermissionFlag.ControlThread )]
    
    
    thanks
    Thursday, September 10, 2009 6:04 PM

Answers

  • Use | to combine flags.  Another option in this case would be to use the individual sub-permission properties exposed by SecurityPermission.  e.g.:

    [assembly: SecurityPermission(SecurityAction.RequestMinimum,
    	UnmanagedCode = true,
    	RemotingConfiguration = true,
    	ControlEvidence = true,
    	ControlThread = true)]
    Thursday, September 10, 2009 6:31 PM