Teams Sharing links – You don’t have access to this file

Today I had to troubleshoot a weird problem in Teams, our users are getting the error “You don’t have access to this file”, but they are members of the Team and there wasn’t any weird SharePoint permissions configured.

After some digging we found out that the file itself existed, users have access but the name of the file has changed.

Basically our users was sharing the link to the file by using Teams, get sharing link.

This is pretty normal thing to do, but Teams when generating this link is actually harcoding the path to the file with the “File name”, and when the file name changed the above link stop working and gave the error above.

This is a problem we had in SharePoint ages ago, where old link dies because of re-name or the file was moved.

The URL before file name change:

https://teams.microsoft.com/l/file/863B4E0E-23FD-41CF-865A-E1F44B8A4CED?tenantId=49de62be-5b4c-40a9-af7c-54059789c497&fileType=docx&objectUrl=https%3A%2F%2Fjh365dev.sharepoint.com%2Fsites%2FJHKontraktHndtering%2FShared%20Documents%2FGeneral%2FLorem%20ipsum.docx&baseUrl=https%3A%2F%2Fjh365dev.sharepoint.com%2Fsites%2FJHKontraktHndtering&serviceName=teams&threadId=19:9d252ac34e73440fb5e6db5e8d49a6a8@thread.skype&groupId=09d94a0b-ab40-46b4-ba37-dc95d7f2ad44

The URL after the file name change:

https://teams.microsoft.com/l/file/863B4E0E-23FD-41CF-865A-E1F44B8A4CED?tenantId=49de62be-5b4c-40a9-af7c-54059789c497&fileType=docx&objectUrl=https%3A%2F%2Fjh365dev.sharepoint.com%2Fsites%2FJHKontraktHndtering%2FShared%20Documents%2FGeneral%2FLorem%20ipsum1.docx&baseUrl=https%3A%2F%2Fjh365dev.sharepoint.com%2Fsites%2FJHKontraktHndtering&serviceName=teams&threadId=19:9d252ac34e73440fb5e6db5e8d49a6a8@thread.skype&groupId=09d94a0b-ab40-46b4-ba37-dc95d7f2ad44

Until this issue is adressed by Microsoft, you might want to instruct your users to use the “SharePoint link” instead of Teams, the SharePoint link will work as long as the file still is in the same Team.

PS! The above error will also occur if the file is inside a folder and the folder name changes.

Cheers

Modern approvals in Office 365 with Power Automate and Microsoft Teams
This blog post is part of Microsoft Teams Week. Find more great blogs here.

About the Author:

Consulting and Teaching | SharePoint and O365
Microsoft Certified Trainer | Microsoft Certified Solution Expert SharePoint

Reference:

Hang, J. (2021). Teams Sharing links – You don’t have access to this file. Available at: https://hangconsult.com/2021/09/08/teams-sharing-links-you-dont-have-access-to-this-file/ [Accessed: 1 December 2021].

Share this on...

Rate this Post:

Share: