using System;
using System.Runtime.InteropServices;
namespace System.Security.Permissions
{
/// Allows security actions for to be applied to code using declarative security. This class cannot be inherited.
// Token: 0x0200055E RID: 1374
[ComVisible(true)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
[Serializable]
public sealed class PrincipalPermissionAttribute : CodeAccessSecurityAttribute
{
/// Initializes a new instance of the class with the specified .
/// One of the values.
// Token: 0x0600322F RID: 12847 RVA: 0x000AC77C File Offset: 0x000AA97C
public PrincipalPermissionAttribute(SecurityAction action)
: base(action)
{
this.authenticated = true;
}
/// Gets or sets a value indicating whether the current principal has been authenticated by the underlying role-based security provider.
/// true if the current principal has been authenticated; otherwise, false.
// Token: 0x170009DA RID: 2522
// (get) Token: 0x06003230 RID: 12848 RVA: 0x000AC78C File Offset: 0x000AA98C
// (set) Token: 0x06003231 RID: 12849 RVA: 0x000AC794 File Offset: 0x000AA994
public bool Authenticated
{
get
{
return this.authenticated;
}
set
{
this.authenticated = value;
}
}
/// Gets or sets the name of the identity associated with the current principal.
/// A name to match against that provided by the underlying role-based security provider.
// Token: 0x170009DB RID: 2523
// (get) Token: 0x06003232 RID: 12850 RVA: 0x000AC7A0 File Offset: 0x000AA9A0
// (set) Token: 0x06003233 RID: 12851 RVA: 0x000AC7A8 File Offset: 0x000AA9A8
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
/// Gets or sets membership in a specified security role.
/// The name of a role from the underlying role-based security provider.
// Token: 0x170009DC RID: 2524
// (get) Token: 0x06003234 RID: 12852 RVA: 0x000AC7B4 File Offset: 0x000AA9B4
// (set) Token: 0x06003235 RID: 12853 RVA: 0x000AC7BC File Offset: 0x000AA9BC
public string Role
{
get
{
return this.role;
}
set
{
this.role = value;
}
}
/// Creates and returns a new .
/// A that corresponds to this attribute.
// Token: 0x06003236 RID: 12854 RVA: 0x000AC7C8 File Offset: 0x000AA9C8
public override IPermission CreatePermission()
{
PrincipalPermission principalPermission;
if (base.Unrestricted)
{
principalPermission = new PrincipalPermission(PermissionState.Unrestricted);
}
else
{
principalPermission = new PrincipalPermission(this.name, this.role, this.authenticated);
}
return principalPermission;
}
// Token: 0x0400149B RID: 5275
private bool authenticated;
// Token: 0x0400149C RID: 5276
private string name;
// Token: 0x0400149D RID: 5277
private string role;
}
}