SecurityPermissionAttribute Třída

Definice

Upozornění

Code Access Security is not supported or honored by the runtime.

Upozornění

CAS support is not available with Silverlight applications.

Umožňuje použít akce zabezpečení pro SecurityPermission pro kód pomocí deklarativního zabezpečení. Tuto třídu nelze dědit.

public ref class SecurityPermissionAttribute sealed : System::Security::Permissions::CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public sealed class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Obsolete("CAS support is not available with Silverlight applications.")]
public sealed class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SecurityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type SecurityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type SecurityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SecurityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Obsolete("CAS support is not available with Silverlight applications.")>]
type SecurityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class SecurityPermissionAttribute
Inherits CodeAccessSecurityAttribute
Dědičnost
Atributy

Poznámky

Upozornění

Zabezpečení přístupu kódu (CAS) bylo zastaralé ve všech verzích rozhraní .NET Framework a .NET. Nedávné verze rozhraní .NET nedodržují poznámky CAS a při použití rozhraní API souvisejících s cas vytvářejí chyby. Vývojáři by měli hledat alternativní způsoby provádění úloh zabezpečení.

Rozsah deklarace, která je povolena, závisí na použitém rozsahu SecurityAction .

Informace o zabezpečení deklarované atributem zabezpečení jsou uloženy v metadatech cíle atributu a systém k tomu přistupuje za běhu. Atributy zabezpečení se používají pouze pro deklarativní zabezpečení. Pro imperativní zabezpečení použijte odpovídající třídu oprávnění.

Při použití SecurityPermissionAttribute třídy postupujte podle akce zabezpečení s požadovanými oprávněními. Každé oprávnění zabezpečení, které lze požadovat, jak je definováno ve výčtu SecurityPermissionFlag , má odpovídající vlastnost ve SecurityPermissionAttribute třídě. Pokud chcete například požadovat možnost přístupu k nespravovanému kódu, postupujte podle příkazu demand s nastavením vlastnosti, která se požaduje, následujícím způsobem: SecurityPermissionAttribute(SecurityAction.Demand, UnmanagedCode=true).

Poznámka

Výjimkou z ekvivalence mezi výčtem SecurityPermissionFlag a SecurityPermissionAttribute vlastnostmi je, že AllFlags hodnota výčtu je reprezentována Unrestricted vlastností (zděděnou z SecurityAttribute třídy). Pokud chcete požadovat všechna oprávnění zabezpečení, zadejte Unrestricted=true.

Konstruktory

SecurityPermissionAttribute(SecurityAction)
Zastaralé.
Zastaralé.

Inicializuje novou instanci SecurityPermissionAttribute třídy se zadaným SecurityActionobjektem .

Vlastnosti

Action
Zastaralé.
Zastaralé.

Získá nebo nastaví akci zabezpečení.

(Zděděno od SecurityAttribute)
Assertion
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k tvrzení, že všichni volající tento kód mají požadované oprávnění pro operaci je deklarován.

BindingRedirects
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu, která označuje, zda má kód oprávnění k provedení přesměrování vazby v konfiguračním souboru aplikace.

ControlAppDomain
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarována oprávnění k manipulaci AppDomain .

ControlDomainPolicy
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarována oprávnění ke změně nebo manipulaci se zásadami zabezpečení domény.

ControlEvidence
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k úpravě nebo manipulaci s důkazy.

ControlPolicy
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarována oprávnění k zobrazení a manipulaci se zásadami zabezpečení.

ControlPrincipal
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k manipulaci s aktuálním objektem zabezpečení.

ControlThread
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k manipulaci s vlákny.

Execution
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění ke spuštění kódu.

Flags
Zastaralé.
Zastaralé.

Získá nebo nastaví všechny příznaky oprávnění obsahující oprávnění SecurityPermission .

Infrastructure
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda se kód může připojit do infrastruktury modulu clý jazyk runtime, jako je přidání remoting kontextových jímek, jímek envoy a dynamických jímek.

RemotingConfiguration
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda kód může konfigurovat typy vzdálené komunikace a kanály.

SerializationFormatter
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu určující, zda kód může použít serializační formátovací modul serializace serializovat nebo deserializovat objekt.

SkipVerification
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k obejití ověření kódu.

TypeId
Zastaralé.
Zastaralé.

Při implementaci v odvozené třídě získá jedinečný identifikátor pro tuto Attributetřídu .

(Zděděno od Attribute)
UnmanagedCode
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu označující, zda je deklarováno oprávnění k volání nespravovaného kódu.

Unrestricted
Zastaralé.
Zastaralé.

Získá nebo nastaví hodnotu určující, zda je deklarováno úplné (neomezené) oprávnění k prostředku chráněného atributem.

(Zděděno od SecurityAttribute)

Metody

CreatePermission()
Zastaralé.
Zastaralé.

Vytvoří a vrátí nový SecurityPermission.

Equals(Object)
Zastaralé.
Zastaralé.

Vrací hodnotu, která určuje, zda je tato instance rovna zadanému objektu.

(Zděděno od Attribute)
GetHashCode()
Zastaralé.
Zastaralé.

Vrátí hodnotu hash pro tuto instanci.

(Zděděno od Attribute)
GetType()
Zastaralé.
Zastaralé.

Získá aktuální Type instanci.

(Zděděno od Object)
IsDefaultAttribute()
Zastaralé.
Zastaralé.

Při přepsání v odvozené třídě označuje, zda je hodnota této instance výchozí hodnotou pro odvozenou třídu.

(Zděděno od Attribute)
Match(Object)
Zastaralé.
Zastaralé.

Při přepsání v odvozené třídě vrátí hodnotu, která označuje, zda se tato instance rovná zadanému objektu.

(Zděděno od Attribute)
MemberwiseClone()
Zastaralé.
Zastaralé.

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
ToString()
Zastaralé.
Zastaralé.

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
Zastaralé.
Zastaralé.

Mapuje sadu názvů na odpovídající sadu identifikátorů pro rozesílání.

(Zděděno od Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
Zastaralé.
Zastaralé.

Načte informace o typu objektu, které lze použít k získání informací o typu pro rozhraní.

(Zděděno od Attribute)
_Attribute.GetTypeInfoCount(UInt32)
Zastaralé.
Zastaralé.

Získá počet rozhraní typu informací, které objekt poskytuje (0 nebo 1).

(Zděděno od Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
Zastaralé.
Zastaralé.

Poskytuje přístup k vlastnostem a metodám vystaveným objektem.

(Zděděno od Attribute)

Platí pro

Viz také