IAutomaticUpdatesSettings2::CheckPermission method (wuapi.h)

[IAutomaticUpdatesSettings2::CheckPermission is no longer supported. Starting with Windows 10 calls to CheckPermission always return S_OK, and a return value of VARIANT_TRUE (users have permissions). However, IAutomaticUpdatesSettings::Save is a no-op, so no changes can be made.]

Determines whether a specific user or type of user has permission to perform a selected action.

Syntax

HRESULT CheckPermission(
  [in] AutomaticUpdatesUserType       userType,
  [in] AutomaticUpdatesPermissionType permissionType,
       VARIANT_BOOL                   *userHasPermission
);

Parameters

[in] userType

An enumeration that indicates the type of user to verify permissions.

[in] permissionType

An enumeration that indicates the user's permission level.

userHasPermission

True if the user has the specified permission type; otherwise, false.

Return value

Returns S_OK if successful. Otherwise, returns a COM or Windows error code.

Remarks

This method can be used to determine whether User Access Control (UAC) must be used to perform an action in the agent, which may obviate the need for prompting if the user type does not have permission to perform the action. For example, unless the agent has elevated permission, the ReadOnly property of the IAutomaticUpdatesSettings interface will always be VARIANT_TRUE. However, even after a user has been elevated, the NotificationLevel (for example) may still be read-only due to Group Policy settings. The CheckPermission method can determine this before elevation is done to prevent prompting in cases where the setting cannot be changed.

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional with SP3 [desktop apps only]
Minimum supported server Windows Server 2003, Windows 2000 Server with SP3 [desktop apps only]
Target Platform Windows
Header wuapi.h
Library Wuguid.lib
DLL Wuapi.dll

See also

IAutomaticUpdatesSettings2