Share via


SiteIdentityPermissionAttribute Kelas

Definisi

Perhatian

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

Memungkinkan tindakan keamanan untuk SiteIdentityPermission diterapkan ke kode menggunakan keamanan deklaratif. Kelas ini tidak dapat diwariskan.

public ref class SiteIdentityPermissionAttribute 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 SiteIdentityPermissionAttribute : 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 SiteIdentityPermissionAttribute : 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 SiteIdentityPermissionAttribute : 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 SiteIdentityPermissionAttribute : 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 SiteIdentityPermissionAttribute = 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 SiteIdentityPermissionAttribute = 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 SiteIdentityPermissionAttribute = 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 SiteIdentityPermissionAttribute = class
    inherit CodeAccessSecurityAttribute
Public NotInheritable Class SiteIdentityPermissionAttribute
Inherits CodeAccessSecurityAttribute
Warisan
Atribut

Keterangan

Perhatian

Keamanan Akses Kode (CAS) tidak digunakan lagi di semua versi .NET Framework dan .NET. Versi terbaru .NET tidak mematuhi anotasi CAS dan menghasilkan kesalahan jika API terkait CAS digunakan. Pengembang harus mencari cara alternatif untuk menyelesaikan tugas keamanan.

Identitas situs hanya didefinisikan untuk kode dari URL dengan protokol HTTP, HTTPS, dan FTP. Situs adalah string antara "//" setelah protokol URL dan "/" berikut, jika ada, misalnya, www.fourthcoffee.com di URL http://www.fourthcoffee.com/process/grind.htm. Ini mengecualikan nomor port. Jika URL yang diberikan adalah http://www.fourthcoffee.com:8000/, situsnya adalah www.fourthcoffee.com, bukan www.fourthcoffee.com:8000.

Situs dapat dicocokkan dengan tepat, atau dengan awalan kartubebas ("*") di pemisah titik. Misalnya, string *.fourthcoffee.com nama situs cocok fourthcoffee.com serta www.fourthcoffee.com. Tanpa kartubebas, nama situs harus sama persis. String nama situs * akan cocok dengan situs apa pun, tetapi tidak akan cocok dengan kode yang tidak memiliki bukti situs.

Penting

Dimulai dengan .NET Framework 4, izin identitas tidak digunakan.

Dalam .NET Framework versi 1.0 dan 1.1, tuntutan pada izin identitas berlaku bahkan ketika rakitan panggilan sepenuhnya dipercaya. Artinya, meskipun rakitan panggilan memiliki kepercayaan penuh, permintaan untuk izin identitas gagal jika assembly tidak memenuhi kriteria yang diminta. Dalam .NET Framework versi 2.0, permintaan izin identitas tidak efektif jika rakitan panggilan memiliki kepercayaan penuh. Ini memastikan konsistensi untuk semua izin, menghilangkan perlakuan izin identitas sebagai kasus khusus.

Cakupan deklarasi yang diizinkan tergantung pada SecurityAction yang digunakan.

Informasi keamanan yang dideklarasikan oleh atribut keamanan disimpan dalam metadata target atribut dan diakses oleh sistem pada durasi. Atribut keamanan hanya digunakan untuk keamanan deklaratif. Untuk keamanan imperatif, gunakan kelas izin yang sesuai.

Konstruktor

SiteIdentityPermissionAttribute(SecurityAction)
Kedaluwarsa.

Menginisialisasi instans SiteIdentityPermissionAttribute baru kelas dengan yang ditentukan SecurityAction.

Properti

Action
Kedaluwarsa.

Mendapatkan atau mengatur tindakan keamanan.

(Diperoleh dari SecurityAttribute)
Site
Kedaluwarsa.

Mendapatkan atau mengatur nama situs kode panggilan.

TypeId
Kedaluwarsa.

Ketika diimplementasikan di kelas turunan, mendapatkan pengidentifikasi unik untuk ini Attribute.

(Diperoleh dari Attribute)
Unrestricted
Kedaluwarsa.

Mendapatkan atau menetapkan nilai yang menunjukkan apakah izin penuh (tidak terbatas) ke sumber daya yang dilindungi oleh atribut dinyatakan.

(Diperoleh dari SecurityAttribute)

Metode

CreatePermission()
Kedaluwarsa.

Membuat dan mengembalikan instans baru .SiteIdentityPermission

Equals(Object)
Kedaluwarsa.

Mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
GetHashCode()
Kedaluwarsa.

Mengembalikan kode hash untuk instans ini.

(Diperoleh dari Attribute)
GetType()
Kedaluwarsa.

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
IsDefaultAttribute()
Kedaluwarsa.

Ketika ditimpa di kelas turunan, menunjukkan apakah nilai instans ini adalah nilai default untuk kelas turunan.

(Diperoleh dari Attribute)
Match(Object)
Kedaluwarsa.

Saat ditimpa di kelas turunan, mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
MemberwiseClone()
Kedaluwarsa.

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
ToString()
Kedaluwarsa.

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
Kedaluwarsa.

Memetakan sekumpulan nama ke sekumpulan pengidentifikasi pengiriman yang sesuai.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
Kedaluwarsa.

Mengambil informasi jenis untuk objek, yang dapat digunakan untuk mendapatkan informasi jenis untuk antarmuka.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfoCount(UInt32)
Kedaluwarsa.

Mengambil jumlah antarmuka informasi jenis yang disediakan objek (baik 0 atau 1).

(Diperoleh dari Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
Kedaluwarsa.

Menyediakan akses ke properti dan metode yang diekspos oleh objek.

(Diperoleh dari Attribute)

Berlaku untuk

Lihat juga