CReplicationProject.GrantAccess Method
Assigns user or group rights to a Commerce Server Staging (CSS) project.
void GrantAccess(string userName, int accessMask)
Parameters
userName
The name of the user or group to be assigned access to the CSS project.accessMask
A numeric value that corresponds to one of the two user rights listed in the following table.Name
Value
Description
CSS_ADMIN_ACCESS
983103
The user has CSS administrator rights.
CSS_USER_ACCESS
131097
The user has CSS operator rights.
Remarks
You must have CSS administrator rights to call this method.
You can use the CheckAccess method to determine whether the user who is currently logged in has CSS administrator or operator rights to a project.
The CReplicationProject.GrantAccess method corresponds to the COM method named ReplicationProject.GrantAccess.
Example
The following example assigns administrator rights to the user named User1 on the project named Project1.
CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
int CSS_ADMIN_ACCESS = 0xF003F;
int CSS_OPERATOR_ACCESS = 0x20019;
CReplicationProject replicationProject;
replicationProject = (CReplicationProject)replicationServer.OpenProject("Project1", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);
replicationProject.GrantAccess("User1", CSS_ADMIN_ACCESS);
See Also
Other Resources
How to Retrieve Project Information
How Are Permissions Granted to CSS Authentication Accounts?
CReplicationProject.CheckAccess Method