AddUserRoleAssignment

Adds a role assignment to the user profile.

Syntax

IRoleAssignment AddUserRoleAssignment(IHierarchicalZone zone)
IRoleAssignment AddUserRoleAssignment(IHierarchicalZoneComputer computer)

Parameters

Specify one of the following parameters when using this method.

Parameter Description

zone

The zone to which the Windows user belongs.

computer

The computer to which the Windows user belongs.

Return value

An empty user role assignment object. This role assignment is not stored in Active Directory until you call the RoleAssignment:Commitmethod.

Discussion

When you assign computer-level overrides for user, group, or computer role assignments, internally Centrify creates a computer zone object, which is a special type of zone that contains the users, groups, and computer role assignments that are specific to only that one computer. Use the second form of this method to obtain a computer-level role assignment for this user.

Exceptions

AddUserRoleAssignment may throw one of the following exceptions:

  • ArgumentNullException if the specified parameter value is null.
  • ApplicationException if the parameter value is not a valid user or if the method failed to create a role assignment because it cannot find the user.