IBDSecurity::GetAccountsForRight Method [C++]

This method is used by the Permissions module and dialog box to retrieve information about all of the accounts associated with the specified combination of entity, element, and right.

Definition

[C++]

HRESULT IBDSecurity::GetAccountsForRight(BSTRbstrEntity,
  VARIANTvarElementVARIANTvarRight_Recordset**ppRSAccounts);

[Visual Basic]

Function GetAccountsForRight(bstrEntity As String,
  OptionalvarElement As Variant,
  OptionalvarRight As Variant,
) As _Recordset

Parameters

  • bstrEntity[C++]
    [in] A BSTR that contains the name of the entity for which records will be returned.
  • bstrEntity[Visual Basic]
    A String that contains the name of the entity for which records will be returned.
  • varElement[C++]
    [in, optional] An optional VARIANT that contains a string specifying the name of the element for which records will be returned.
  • varElement[Visual Basic]
    An optional Variant that contains a string specifying the name of the element for which records will be returned.
  • varRight[C++]
    [in, optional] An optional VARIANT that contains a string specifying the name of the right for which records will be returned.
  • varRight[Visual Basic]
    An optional Variant that contains a string specifying the name of the right for which records will be returned.
  • ppRSAccounts [C++]
    [out, retval] The address of a pointer to an ADO _Recordset object used to return account and permission information corresponding to the provided entity, element and right. See the Remarks section for more details.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns an ADO _Recordset object containing the account and permission information corresponding to the provided entity, element, and right. See the Remarks section for more details.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

This method will not typically be called from any Commerce Server Business Desk modules other than the Permissions module and dialog box.

The returned record set contains one record per matching account in the SDT and includes the fields: SID (security identifier), Entity, Element, Right, and Deny.

If either of the optional parameters (varElement and/or varRight), is not provided, they are treated as wildcards. In other words, records will be included in the result regardless of their element and/or right values.

[C++] The ppRSAccounts parameter contains valid data only if the method returns successfully.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' rsAccounts is a Variant to which an ADO _Recordset object 
' will be assigned.
' g_MSCSBDSecurityis the global BD security object
' created in the page Global.asa.

' Will return a Recordset containing one record for each account that
' has been explicitly set as allowed or disallowed from editing the
' shoes category within a catalog.

rsAccounts = _
    g_MSCSBDSecurity.GetAccountsForRight("Category", _
                                              "Shoes", _
                                              "edit")

See Also

[C++]BDSecurity Object

[Visual Basic]BDSecurity Object

Security

Copyright © 2005 Microsoft Corporation.
All rights reserved.