ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Workflow.Models.JobModels Namespace / Job Class / CanUserAssignJob Method
The user to test for the ability to assign the job
Example

In This Topic
    CanUserAssignJob Method
    In This Topic
    Determines whether the job can be assigned to the specified user
    Syntax
    public bool CanUserAssignJob( 
       UserDetails currentUser
    )
    Public Function CanUserAssignJob( _
       ByVal currentUser As UserDetails _
    ) As Boolean

    Parameters

    currentUser
    The user to test for the ability to assign the job

    Return Value

    Whether the job can be assigned
    Remarks
    Job can be assigned if, it isn't closed, or on hold and the user has the AssignAnyJob privilege. If the user only has the GroupJobAssign or IndividualJobAssign privileges the job is assignable only if it is assigned to the current user, assigned to any group of the current user or assigned to any user within any group of the current user (only for GroupJobAssign). If the job is on hold the user will also require the CanUpdatePropsforHeldJobs privilege.
    Example
    UserDetails user = WorkflowModule.GetUser();
    Job job = await jobManager.GetJob(jobID);
    bool canAssign = job.CanUserAssignJob(user);
    if (canAssign)
    {
        job.AssignedTo = "newUsername";
        await job.Save();
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also