This method lists the users with their access privileges on the project.
Syntax
ReplicationProject.EnumAccess(Iterator, Access)
Parameters
Iterator
Used by the service to enumerate the list of users. This value should be initialized to zero, and should not be modified.
Access
The returned access value.
Remarks
You must have Site Server Publishing administrator privileges on the server to call this method.
The access privileges are described in the following table.
Name | Value | Description |
CRS_ADMIN_ACCESS | 983103 | The user has Site Server Publishing administrator access privileges. |
CRS_USER_ACCESS | 131097 | The user has Site Server Publishing operator access privileges. |
Example
The following example displays the access privileges of the users on Project1.
Option Explicit
On Error Resume Next
const OPEN_EXISTING_PROJECT = 2
const CRS_USER_ACCESS = 0&20019
const CRS_ADMIN_ACCESS = 0&F003F
const CRS_ERROR_NO_MORE_ITEMS = 0&80003B17
dim ReplServer
set ReplServer = CreateObject("Crsapi.ReplicationServer")
ReplServer.Initialize("")
dim Project
set Project = ReplServer.OpenProject("Project1", OPEN_EXISTING_PROJECT)
dim UserName
dim AccessPriv
dim Iterator
Iterator = 0
dim ReplError
do while True
'Clear any error text
Err.Clear
UserName = Project.EnumAccess(Iterator, AccessPriv)
'Quit if "No more items" error
ReplError = Err.Number
if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do
if AccessPriv = 0 then
Wscript.Echo UserName & " has no access."
elseif AccessPriv = CRS_USER_ACCESS then
Wscript.Echo UserName & " has operator access."
elseif AccessPriv = CRS_ADMIN_ACCESS then
Wscript.Echo UserName & " has administrator access."
end if
Loop
'Release objects
set ReplProject = Nothing
set ReplServer = Nothing