GetResourcesResCanViewByViewIDFromList Method
Description
Returns a subset of a specified list of resources for which a resource account has a specified resource permission using the Microsoft Office Project Server 2003 security object. The resource list can be with or without a specified view ID.
Syntax
Function GetResourcesResCanViewByViewIDFromList( _
ByVal res_id As Long, _
ByVal act_id As Long, _
ByVal view_id As Long, _
ByVal bstrFromList As String, _
Optional ByVal fGetEntOnly As Long = 0 _
) As String
Parameters
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
res_id |
Required Long. The resource ID from MSP_WEB_RESOURCES.WRES_ID. |
||||||||||||||
act_id |
Required Long. The resource category permission ID. There are only six permissions for resource objects:
|
||||||||||||||
view_id |
Required Long. The view ID, from MSP_WEB_VIEW_REPORTS.WVIEW_ID. Set view_id = -1 if the permission check is not associated with a view. |
||||||||||||||
bstrFromList |
Required String. The comma-separated list of resources to check. If fGetEntOnly is 1 (True), the list contains RES_EUID; otherwise, it contains WRES_ID values. |
||||||||||||||
fGetEntOnly |
Optional Long. Set to 1 (True) to return only enterprise resources, as RES_EUID. The default 0 (False) returns all resources, as WRES_ID. |
Return Value
The GetResourcesResCanViewByViewIDFromList method returns a comma-separated list of resource IDs as a String value.
Remarks
If act_id is not one of the six values shown, or one of the other parameters is not correct, GetResourcesResCanViewByViewIDFromList returns an empty string (""). For more information, see GetNumberOfResourcesResCanViewByViewID Function and GetResourcesResCanViewByViewID Function.
Example
The following example returns the subset of resource IDs in the specified WRES_ID list for which the resource 101 can adjust actuals (resource category permission ID 513). The example is for Microsoft Visual Basic 6.0.
Dim sResult as String
Dim sList2Check as String
sList2Check = "102,103,104,105"
Set oSec = CreateObject("PjSvrSecurity.PjSvrSecurity")
oSec.SetDBConnection "ProjectServer"
sResult = oSec.GetResourcesResCanViewByViewIDFromList(101, 513, 51, sList2Check)
Set oSec = Nothing