Share via


IBDSecurity::CanUserAccess Method [C++]

Use this method to determine whether the current user has read access rights to the specified Commerce Server Business Desk module.

This method is included for backward-compatibility with Commerce Server 2002. It is not part of the new Business Desk security mechanism.

Definition

[C++]

HRESULT IBDSecurity::CanUserAccess(BSTRbstrPath,
  VARIANT_BOOL*pbAccessOK);

[Visual Basic]

Function CanUserAccess(bstrPath As String,
) As Boolean

Parameters

  • bstrPath[C++]
    [in] A BSTR that contains the file name and path for a Business Desk module.
  • bstrPath[Visual Basic]
    A String that contains the file name and path for a Business Desk module.
  • pbAccessOK[C++]
    [out, retval] The address of a VARIANT_BOOL used to return either TRUE or FALSE. A value of TRUE indicates that the current user has read access rights to the specified file. A value of FALSE indicates that the current user does not have read access rights to the specified file.

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 a Boolean set to either True or False. A value of True indicates that the current user has read access rights to the specified file. A value of False indicates that the current user does not have read access rights to the specified file.

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

Whether the user has read access to the specified Business Desk module is determined from the entries in the access control lists (ACLs) set for the action page ASP file.

[C++] The pbAccessOK 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

' bAccess is a Boolean
' oBDSecurity is a Commerce.BDSecurity object
' CatalogEditor.asp is an ASP page corresponding to a Business Desk module

bAccess = oBDSecurity.CanUserAccess("CatalogEditor.asp")

See Also

[C++] BDSecurity Object

[Visual Basic]BDSecurity Object

Security

Copyright © 2005 Microsoft Corporation.
All rights reserved.