OraclePermission 类

定义

警告

此 API 现已过时。

启用用于 Oracle 的 .NET Framework 数据提供程序,以帮助确保用户具有足够的安全级别来访问 Oracle 数据库。Enables the .NET Framework Data Provider for Oracle to help ensure that a user has a security level adequate to access an Oracle database.

public ref class OraclePermission sealed : System::Security::CodeAccessPermission, System::Security::Permissions::IUnrestrictedPermission
[System.Obsolete("OraclePermission has been deprecated. https://go.microsoft.com/fwlink/?LinkID=144260", false)]
[System.Serializable]
public sealed class OraclePermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission
type OraclePermission = class
    inherit CodeAccessPermission
    interface IUnrestrictedPermission
Public NotInheritable Class OraclePermission
Inherits CodeAccessPermission
Implements IUnrestrictedPermission
继承
OraclePermission
属性
实现

注解

此类型已弃用,并将在 .NET Framework 的未来版本中删除。This type is deprecated and will be removed in a future version of the .NET Framework. 有关详细信息,请参阅Oracle 和 ADO.NETFor more information, see Oracle and ADO.NET.

IsUnrestricted 属性优先于 AllowBlankPassword 属性。The IsUnrestricted property takes precedence over the AllowBlankPassword property. 因此,如果将 AllowBlankPassword 设置为 false,则还必须将 IsUnrestricted 设置为 false,以防止用户使用空白密码建立连接。Therefore, if you set AllowBlankPassword to false, you must also set IsUnrestricted to false to prevent a user from making a connection using a blank password.

有关演示如何使用安全要求的示例,请参阅代码访问安全性和 ADO.NETFor an example demonstrating how to use security demands, see Code Access Security and ADO.NET.

构造函数

OraclePermission(PermissionState)

使用其中一个 PermissionState 值初始化 OraclePermission 类的新实例。Initializes a new instance of the OraclePermission class with one of the PermissionState values.

属性

AllowBlankPassword

获取一个值,该值指示是否允许使用空白密码。Gets a value indicating whether a blank password is allowed.

方法

Add(String, String, KeyRestrictionBehavior)

创建一组新的权限。Creates a new set of permissions.

Assert()

声明调用代码能够通过调用此方法的代码,访问受权限请求保护的资源,即使未对堆栈中处于较高位置的调用方授予访问该资源的权限。Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. 使用 Assert() 会引起安全问题。Using Assert() can create security issues.

(继承自 CodeAccessPermission)
Copy()

由派生类实现时,创建并返回当前权限对象的相同副本。When implemented by a derived class, creates and returns an identical copy of the current permission object.

Demand()

如果未对调用堆栈中处于较高位置的所有调用方授予当前实例所指定的权限,则在运行时强制 SecurityExceptionForces a SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance.

(继承自 CodeAccessPermission)
Deny()

防止处于调用堆栈较高位置的调用函数使用可以调用此方法来访问当前实例指定资源的代码。Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance.

(继承自 CodeAccessPermission)
Equals(Object)

确定指定的 CodeAccessPermission 对象是否等于当前的 CodeAccessPermissionDetermines whether the specified CodeAccessPermission object is equal to the current CodeAccessPermission.

(继承自 CodeAccessPermission)
FromXml(SecurityElement)

当在派生类中替代时,用 XML 编码重新构造具有指定状态的安全对象。When overridden in a derived class, reconstructs a security object with a specified state from an XML encoding.

GetHashCode()

获取 CodeAccessPermission 对象的哈希代码,此代码适合在哈希算法和数据结构(例如哈希表)中使用。Gets a hash code for the CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table.

(继承自 CodeAccessPermission)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Intersect(IPermission)

通过派生类实现时,创建和返回是当前权限和指定权限的交集的权限。When implemented by a derived class, creates and returns a permission that is the intersection of the current permission and the specified permission.

IsSubsetOf(IPermission)

通过派生类实现时,确定当前权限是否为指定权限的子集。When implemented by a derived class, determines whether the current permission is a subset of the specified permission.

IsUnrestricted()

返回一个值,该值指示在不了解权限语义的情况下是否可以将权限表示为无限制。Returns a value indicating whether the permission can be represented as unrestricted without any knowledge of the permission semantics.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
PermitOnly()

防止处于调用堆栈较高位置的调用函数使用此代码,此代码将调用此方法来访问除当前实例指定的资源以外的所有资源。Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance.

(继承自 CodeAccessPermission)
ToString()

创建并返回当前权限对象的字符串表示形式。Creates and returns a string representation of the current permission object.

(继承自 CodeAccessPermission)
ToXml()

创建安全对象及其当前状态的 XML 编码。Creates an XML encoding of the security object and its current state.

Union(IPermission)

创建一个权限,该权限是当前权限与指定权限的并集。Creates a permission that is the union of the current permission and the specified permission.

显式界面实现

IPermission.Demand() (继承自 CodeAccessPermission)
IStackWalk.Assert() (继承自 CodeAccessPermission)
IStackWalk.Demand() (继承自 CodeAccessPermission)
IStackWalk.Deny() (继承自 CodeAccessPermission)
IStackWalk.PermitOnly() (继承自 CodeAccessPermission)

适用于