Skip to content

CreateLinkPostRequestBody in 6.2.0 defaults RetainInheritedPermissions = false #3165

Description

@hp-bc

Describe the bug

When calling CreateLinkPostRequestBody to create a sharing link and RetainInheritedPermissions is not defined, it defaults to false.

This is the opposite of the behavior listed in the learn article.

Defining RetainInheritiedPermissions true or false operates as expected.

This bug doesn't appear in this repo but it does appear in the Python SDK #1536

Expected behavior

The default behavior should be to retain the items current permissions, ala RetainInheritedPermissions = true.

How to reproduce

var requestBody = new CreateLinkPostRequestBody
{
Type = "view",
Scope = "users",
ExpirationDateTime = DateTime.UtcNow.AddMinutes(10),
Recipients =
[
new() {
Email = "user@domain.com"
}
]
};

await _graph!.Drives[DriveID].Items[DriveItemID].CreateLink.PostAsync(requestBody, cancellationToken: cancellationToken).ConfigureAwait(false) ?? throw new FileNotFoundException();

//Will result in user@domain.com getting access for ten minutes but all other access will be wiped. Adding 'RetainInheritedPermissions = true,' corrects the behavior.

SDK Version

6.2.0

Latest version known to work for scenario above?

No response

Known Workarounds

Define RetainInheritedPermissions when creating a new CreateLinkPostRequestBody

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions