Define access permissions on a case

Restricting access to cases is done through access codes on the File (case).

The AccessCode property is a Permission type modeled as a complex type with two sub-properties: Code and Expression.

The Code part of the property represents the actual value in the database, and the Expression part of the property is the SOM notation used to describe which users may access the case.

If corporate access codes are used: A pipe separated list of (subject)&(user/group)

If standard access codes are used: A pipe separated list of users and groups

Example: Creating a case with restricted access using Corporate access codes


File file = new File
{
    Title = "Case Title",
    FileClass_Value = "19",
    // set read permission
    AccessCode = new ODataWorkZoneClient.WorkZone.Som.Permission.Read
    {
        Expression = "(Subject&User1)|(Subject&Group1)"
    },
    // set write permission
    UpdateCode = new ODataWorkZoneClient.WorkZone.Som.Permission.Write
    {
        Expression = "User1"
    }
};
 
DataServiceCollection<File> files = new DataServiceCollection<File>(context);
files.Add(file);
 
context.SaveChanges(SaveChangesOptions.Batch);
				

Kopibilledet mangler