Share via


CheckSPObjectListPermission Method

Description

Checks if a specified resource account has a specified object permission on an entire list of objects using the Microsoft Office Project Server 2003 security object.

Syntax

Function CheckSPObjectListPermission( _
   ByVal sp_guid As String, _
   ByVal bstrObjectIDList As String, _
   ByVal so_type As Long, _
   ByVal act_id As Long _
) As Long

Parameters

Parameter Description

sp_guid

Required String. Resource account GUID, as in WRES_GUID MSP_WEB_RESOURCES.WRES_GUID.

bstrObjectIDList

Required String. Comma separated list of object IDs. If the object IDs are projects, then bstrObjectIDList contains the comma separated list of project IDs, as in MSP_WEB_PROJECTS.WPROJ_ID .

so_type

Required Long. The object type.

so_type Object Type
1 Projects
2 Resources
3 Views (do nothing)
4 Models

act_id

Required Long. The object/category permission id to check.

Return Value

The CheckSPObjectListPermission method returns True (1) or False (0) as a Long (4 byte integer) value.

Remarks

If the resource account is not allowed for any one of the objects in the list, CheckSPObjectListPermission returns False.

Example

The following example checks a resource for Permission ID 101 in projects 21,22, and 23. The example is for Microsoft Visual Basic 6.0.

Dim lResult as Long
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
lResult = oSec.CheckSPObjectListPermission("{82F50D90-F5F0-4B5D-8384-839B98823D2F}", _
               "21,22,23", 1, 101)
Set oSec = Nothing