SqlClientPermission Classe

Definição

Cuidado

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

Permite que o Provedor de Dados .NET Framework para SQL Server ajude a garantir que um usuário tenha um nível de segurança suficiente para acessar uma fonte de dados.Enables the .NET Framework Data Provider for SQL Server to help make sure that a user has a security level sufficient to access a data source.

public ref class SqlClientPermission sealed : System::Data::Common::DBDataPermission
public sealed class SqlClientPermission : System.Data.Common.DBDataPermission
[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 SqlClientPermission : System.Data.Common.DBDataPermission
[System.Serializable]
public sealed class SqlClientPermission : System.Data.Common.DBDataPermission
type SqlClientPermission = class
    inherit DBDataPermission
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SqlClientPermission = class
    inherit DBDataPermission
[<System.Serializable>]
type SqlClientPermission = class
    inherit DBDataPermission
Public NotInheritable Class SqlClientPermission
Inherits DBDataPermission
Herança
Atributos

Comentários

A IsUnrestricted propriedade tem precedência sobre a AllowBlankPassword propriedade.The IsUnrestricted property takes precedence over the AllowBlankPassword property. Portanto, se você definir AllowBlankPassword como false , também deverá definir IsUnrestricted como false para impedir que um usuário faça uma conexão usando uma senha em branco.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.

Observação

Ao usar permissões de segurança de acesso ao código para ADO.NET, o padrão correto é iniciar com o caso mais restritivo (sem permissões) e, em seguida, adicionar as permissões específicas necessárias para a tarefa específica que o código precisa executar.When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are needed for the particular task that the code needs to perform. O padrão oposto, começando com todas as permissões e, em seguida, negando uma permissão específica, não é seguro, pois há muitas maneiras de expressar a mesma cadeia de conexão.The opposite pattern, starting with all permissions and then denying a specific permission, is not secure, because there are many ways of expressing the same connection string. Por exemplo, se você iniciar com todas as permissões e depois tentar negar o uso da cadeia de conexão “server=someserver”, a cadeia de caracteres “server=someserver.mycompany.com” ainda será permitida.For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. Ao iniciar sempre sem conceder absolutamente nenhuma permissão, você reduz as chances de haver brechas no conjunto de permissões.By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.

Construtores

SqlClientPermission()
Obsoleto.
Obsoleto.

Inicializa uma nova instância da classe SqlClientPermission.Initializes a new instance of the SqlClientPermission class.

SqlClientPermission(PermissionState)

Inicializa uma nova instância da classe SqlClientPermission.Initializes a new instance of the SqlClientPermission class.

SqlClientPermission(PermissionState, Boolean)
Obsoleto.
Obsoleto.

Inicializa uma nova instância da classe SqlClientPermission.Initializes a new instance of the SqlClientPermission class.

Propriedades

AllowBlankPassword

Obtém um valor que indica se uma senha em branco é permitida.Gets a value indicating whether a blank password is allowed.

(Herdado de DBDataPermission)

Métodos

Add(String, String, KeyRestrictionBehavior)

Adiciona uma nova cadeia de conexão e um conjunto de palavras-chave restritas ao objeto SqlClientPermission.Adds a new connection string and a set of restricted keywords to the SqlClientPermission object.

Assert()

Declara que o código de chamada pode acessar o recurso protegido por uma demanda de permissão através do código que chama este método, mesmo que os chamadores na pilha não tenham recebido permissão para acessar o recurso.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. Usar Assert() pode criar problemas de segurança.Using Assert() can create security issues.

(Herdado de CodeAccessPermission)
Clear()

Remove todas as permissões que foram adicionadas anteriormente usando o método Add(String, String, KeyRestrictionBehavior).Removes all permissions that were previous added using the Add(String, String, KeyRestrictionBehavior) method.

(Herdado de DBDataPermission)
Copy()

Retorna o SqlClientPermission como um IPermission.Returns the SqlClientPermission as an IPermission.

CreateInstance()

Cria uma nova instância da classe DBDataPermission.Creates a new instance of the DBDataPermission class.

(Herdado de DBDataPermission)
Demand()

Força um SecurityException no tempo de execução se todos os chamadores no topo da pilha de chamadas não receberam as permissões especificadas pela instância atual.Forces a SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance.

(Herdado de CodeAccessPermission)
Deny()
Obsoleto.
Obsoleto.

Impede que os chamadores no nível superior da pilha de chamadas usem o código que chama esse método para acessar o recurso especificado pela instância atual.Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance.

(Herdado de CodeAccessPermission)
Equals(Object)

Determina se o objeto CodeAccessPermission especificado é igual ao CodeAccessPermission atual.Determines whether the specified CodeAccessPermission object is equal to the current CodeAccessPermission.

(Herdado de CodeAccessPermission)
FromXml(SecurityElement)

Reconstrói um objeto de segurança com um estado especificado de uma codificação XML.Reconstructs a security object with a specified state from an XML encoding.

(Herdado de DBDataPermission)
GetHashCode()

Obtém um código hash para o objeto CodeAccessPermission atual, adequado para algoritmos de hash e estruturas de dados, tais como uma tabela de hash.Gets a hash code for the CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table.

(Herdado de CodeAccessPermission)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
Intersect(IPermission)

Retorna um novo objeto de permissão que representa a interseção de um objeto de permissão atual e o objeto de permissão especificado.Returns a new permission object representing the intersection of the current permission object and the specified permission object.

(Herdado de DBDataPermission)
IsSubsetOf(IPermission)

Retorna um valor que indica se o objeto de permissão atual é um subconjunto do objeto de permissão especificado.Returns a value indicating whether the current permission object is a subset of the specified permission object.

(Herdado de DBDataPermission)
IsUnrestricted()

Retorna um valor que indica se a permissão pode ser representada como irrestrita sem qualquer conhecimento da semântica da permissão.Returns a value indicating whether the permission can be represented as unrestricted without any knowledge of the permission semantics.

(Herdado de DBDataPermission)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
PermitOnly()

Impede que os chamadores no topo da pilha de chamadas usem o código que chama esse método para acessar todos os recursos, com exceção do recurso especificado pela instância atual.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.

(Herdado de CodeAccessPermission)
ToString()

Cria e retorna uma representação de cadeia de caracteres do objeto de permissão atual.Creates and returns a string representation of the current permission object.

(Herdado de CodeAccessPermission)
ToXml()

Cria uma codificação XML do objeto de segurança e seu estado atual.Creates an XML encoding of the security object and its current state.

(Herdado de DBDataPermission)
Union(IPermission)

Retorna um novo objeto de permissão que é a união dos objetos de permissão especificado e atual.Returns a new permission object that is the union of the current and specified permission objects.

(Herdado de DBDataPermission)

Implantações explícitas de interface

IPermission.Demand()

Gera um SecurityException em tempo de execução se o requisito de segurança não é atendido.Throws a SecurityException at run time if the security requirement is not met.

(Herdado de CodeAccessPermission)
IStackWalk.Assert()

Declara que código de chamada pode acessar o recurso identificado pelo objeto de permissão atual, mesmo que os chamadores na pilha não tenham recebido permissão para acessar o recurso.Asserts that the calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.

(Herdado de CodeAccessPermission)
IStackWalk.Demand()

Determina em tempo de execução se a permissão especificada pelo objeto de permissão atual foi ou não concedida a todos os chamadores na pilha de chamadas.Determines at run time whether all callers in the call stack have been granted the permission specified by the current permission object.

(Herdado de CodeAccessPermission)
IStackWalk.Deny()

Faz com que cada Demand() para o objeto atual que passa pelo código de chamada falhe.Causes every Demand() for the current object that passes through the calling code to fail.

(Herdado de CodeAccessPermission)
IStackWalk.PermitOnly()

Causa a falha de cada Demand() de todos os objetos que passam pelo código de chamada, exceto o atual, mesmo que o código superior na pilha de chamadas tenha recebido permissão para acessar outros recursos.Causes every Demand() for all objects except the current one that pass through the calling code to fail, even if code higher in the call stack has been granted permission to access other resources.

(Herdado de CodeAccessPermission)

Aplica-se a