Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Union Entre Plusieurs ‘PrincipalPermissions’

Exemple,d'utilisation,de,'PermissionSet'
{filelink=17850}

using System;
using System.Security.Permissions;
 
class MainClass {
 
    public static void Method2() {
        PrincipalPermission perm1 = new PrincipalPermission(null, @"MACHINEManagers");
 
        PrincipalPermission perm2 = new PrincipalPermission(null, @"MACHINEDevelopers");
 
        perm1.Union(perm2).Demand();
    }
 
    public static void Method3() {
        PrincipalPermission perm = new PrincipalPermission(@"MACHINETester", @"MACHINEManagers");
        perm.Demand();
    }
    [PrincipalPermission(SecurityAction.Demand, Name = @"MACHINETester")]
    public static void Method4() {
    }
 
    [PrincipalPermission(SecurityAction.Demand, Role = @"MACHINEManagers")]
    [PrincipalPermission(SecurityAction.Demand, Role = @"MACHINEDevelopers")]
    public static void Method5() {
 
    }
    [PrincipalPermission(SecurityAction.Demand, Name = @"MACHINETester",
        Role = @"MACHINEManagers")]
    public static void Method6() {
 
    }
}

No comments yet.

Leave a Comment