Entity.CheckAccess Method

Gets the rights the current user has on one or more entity instances.

Namespace:  Microsoft.Office.Server.ApplicationRegistry.MetadataModel
Assembly:  Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Syntax

'Declaration
Public Function CheckAccess ( _
    subIdentifierArrayArray As Object(), _
    lobSystemInstance As LobSystemInstance _
) As Long()
'Usage
Dim instance As Entity
Dim subIdentifierArrayArray As Object()
Dim lobSystemInstance As LobSystemInstance
Dim returnValue As Long()

returnValue = instance.CheckAccess(subIdentifierArrayArray, _
    lobSystemInstance)
public long[] CheckAccess(
    Object[] subIdentifierArrayArray,
    LobSystemInstance lobSystemInstance
)

Parameters

  • subIdentifierArrayArray
    Type: []
    A collection of a collection of sub-identifiers, which represents a collection of EntityInstances of that Entity. Each element in the top level collection represents an array of sub-identifier values for a single EntityInstance. For example, if an Entity has only a single identifier, the inner array would contain only one element.
    Consider a Customer entity which is identified by an integer CustomerNumber. Calling CheckAccess in the following manner:
    long[] rights[] = CheckAccess(new Object[]{33}, new Object[]{3}
    would return the rights for Customer EntityInstances with Id 33 and 3.

Return Value

Type: []
A single 'long' number for each EntityInstance represented in input. The 'long' represents the Rights the user executing the CheckAccess method has for the corresponding EntityInstance. A Right can be a single bit or a collection of bits in the long.

Remarks

The CheckAccess call works in a manner similar to the FindSpecific method call, in that the Business Data Catalog translates the call into a SQL query or a more complex backend WebService WebMethod invocation. The main difference is that the FIndSpecific works to return a single EntityInstance; the CheckAccess method returns results (Rights) for one or more than one EntityInstance in the same call.

The CheckAccess call works by invoking the MethodInstance on the Entity that has the 'AccessChecker' MethodInstanceType. The result of the CheckAccess call can be used by Business Data client applications. For example, consider a user building a custom Web Part on the Business Data Catalog that displays Create, Edit, and Delete Actions for an EntityInstance. Now by defining an AccessChecker, the user could call Entity.CheckAccess and then conditionally enable one or more of the Actions depending on what rights are returned.

The Entity.CheckAccess method is also executed by the Business Data Catalog Security Trimmer each time the Search Query Processor returns search results matching the crawl rule the Business Data Catalog security trimmer is associated with. When the Entity.CheckAccess method is called, the Business Data Catalog in turn executes the back-end API described by the AccessChecker method instance registered for that entity. The back-end API returns the rights the current user has on the entity instance or instances. This is relayed back to the Entity.CheckAccess method, and finally to the security trimmer, which uses this information to trim the results before displaying the results to the user.

See Also

Reference

Entity Class

Entity Members

Microsoft.Office.Server.ApplicationRegistry.MetadataModel Namespace