Düzenle

Aracılığıyla paylaş


GetCallerAccessRights method of the __SystemSecurity class

The __SystemSecurity::GetCallerAccessRights method sets the rights parameter as a bitmap with each bit corresponding to an access right. Any client can call this to determine which rights the client has. This method is useful for clients that enable or disable features. For example, a GUI application might disable a button if the currently logged-on user does not have method execution rights.

Any enabled client has the right to call GetCallerAccessRights, even if that client does not have general method execution rights.

Syntax

HRESULT GetCallerAccessRights(
  [out] sint32 rights
);

Parameters

rights [out]

Access rights of the client. For more information, see __SystemSecurity and WMI Security Constants.

WBEM_ENABLE (1 (0x1))

Enables the account and grants the user read permissions. This is the default access right for all users.

WBEM_METHOD_EXECUTE (2 (0x2))

Allows the execution of methods.

Note

Providers may perform additional access checks.

WBEM_FULL_WRITE_REP (4 (0x4))

Allows the caller, security context, or user to write to classes and instances except for system classes.

WBEM_PARTIAL_WRITE_REP (8 (0x8))

Allows the caller, security context, or user to write provider instances but not static classes or static instances to the repository.

WBEM_WRITE_PROVIDER (16 (0x10))

Allows the caller, security context, or user to write classes and instances to providers.

Note

Impersonating providers may do additional access checks.

WBEM_REMOTE_ACCESS (32 (0x20))

Allows a user account to remotely perform any operations allowed by the permissions set by other bits.

READ_CONTROL (131072 (0x20000))

Allows read access to the security descriptors.

WRITE_DAC (262144 (0x40000))

Allows write access to discretionary access control lists (DACL).

Return value

This method returns an HRESULT that indicates the status of the method call. The following list lists the return values that are of significance to Set9XUserList. For scripting and Visual Basic applications, the result can be obtained from OutParameters.ReturnValue. For more information, see Constructing InParameters Objects and Parsing OutParameters Objects.

WBEM_E_METHOD_DISABLED

This method is not supported on supported versions of Windows.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
All WMI namespaces

See also

WMI System Classes

__SystemSecurity

__SystemSecurity::GetSD

__SystemSecurity::SetSD

WMI Security Constants

Win32_ACE

Win32_SecurityDescriptor

Securing WMI Namespaces

WMI Security Constants