Skip to content

Latest commit

 

History

History
114 lines (90 loc) · 4.06 KB

nf-comsvcs-isecuritycallcontext-isuserinrole.md

File metadata and controls

114 lines (90 loc) · 4.06 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:comsvcs.ISecurityCallContext.IsUserInRole
ISecurityCallContext::IsUserInRole (comsvcs.h)
Determines whether the specified user is in the specified role.
ISecurityCallContext interface [COM+]
IsUserInRole method
ISecurityCallContext.IsUserInRole
ISecurityCallContext::IsUserInRole
IsUserInRole
IsUserInRole method [COM+]
IsUserInRole method [COM+]
ISecurityCallContext interface
_cos_ISecurityCallContext_IsUserInRole
comsvcs/ISecurityCallContext::IsUserInRole
cos.isecuritycallcontext_isuserinrole
cos\isecuritycallcontext_isuserinrole.htm
cos
aae5d89a-be46-40c8-ad5d-21f9b3a9c04f
12/05/2018
ISecurityCallContext interface [COM+],IsUserInRole method, ISecurityCallContext.IsUserInRole, ISecurityCallContext::IsUserInRole, IsUserInRole, IsUserInRole method [COM+], IsUserInRole method [COM+],ISecurityCallContext interface, _cos_ISecurityCallContext_IsUserInRole, comsvcs/ISecurityCallContext::IsUserInRole, cos.isecuritycallcontext_isuserinrole
comsvcs.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Windows
19H1
ISecurityCallContext::IsUserInRole
comsvcs/ISecurityCallContext::IsUserInRole
c++
APIRef
kbSyntax
COM
ComSvcs.h
ISecurityCallContext.IsUserInRole

ISecurityCallContext::IsUserInRole

-description

Determines whether the specified user is in the specified role.

-parameters

-param pUser [in]

A pointer to value holding the User ID of the user whose role membership is to be checked. If you intend to pass the security identifier (SID) to IsUserInRole, this parameter should meet the following requirements: V_VT(pUser) == (VT_ARRAY|VT_UI1) && V_ARRAY(pUser)->cDims == 1.

-param bstrRole [in]

The name of the role.

-param pfInRole [out]

TRUE if the user is in the specified role; FALSE if not. If the specified role is not defined for the application, FALSE is returned. This parameter is set to TRUE if role-based security is not enabled.

-returns

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following values.

Return code Description
S_OK
The role specified in the bstrRole parameter is a recognized role, and the Boolean result returned in the pfIsInRole parameter indicates whether the user is in that role.
CONTEXT_E_ROLENOTFOUND
The role specified in the bstrRole parameter does not exist.

-remarks

Use this method to limit access to sections of code that should not be executed unless the caller is a member of the specified role. Windows groups and users are assigned to an application's roles using the Component Services administration tool. For more information about roles, see Role-Based Security.

Because IsUserInRole is TRUE when role-based security is not enabled, it is a good idea to call IsSecurityEnabled before calling IsUserInRole to ensure that IsUserInRole returns useful information.

-see-also

ISecurityCallContext

Programmatic Component Security