question

SyedMuazzamAhmed avatar image
0 Votes"
SyedMuazzamAhmed asked CaseyYangMSFT-4714 commented

Content Editor webpart accessing a restricted csv file

Hello,

I have content editor web part accessing a csv file to display selective data from it and the csv file is in a document library of the same site collection. I am restricting permissions to this library. If user has a permission to the document library and access the content editor web part page then he can see the functionality. If user has no permission on the library and access content editor web part then he gets no data in CEWP. I want CEWP to access data from the csv file even if the user does not have permission to the documents library.

Can anyone please help me how I can do it.

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SyedMuazzamAhmed avatar image
0 Votes"
SyedMuazzamAhmed answered CaseyYangMSFT-4714 commented

Adding the workarounds I found for people who might land here.

I found 2 work arounds and I am using both of them for different sets of users.

1) First workaround is setting 'Restricted Read' as permission level of the User. With this users cannot access documents library but the CEWP easily reads the files within it and renders on site page when those users open it. The issue with this solution is it stops the user from accessing other files too which I want them to be able to open.

2) The second solution is adding a script snippet in my MasterPage which redirects the user to home page of the SharePoint Site if the User tries to access specific files. The Code reads permission level of the user, and then matches the current URL of the page to the URL of the document I want to restrict. It redirects the user to homepage site if the URL is that of the document.

Hope what I wrote is intelligible 😅

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SyedMuazzamAhmed

Thank you for your reply. Congratulations on solving this issue and thanks for sharing your solution. Thanks again for your contribution.

0 Votes 0 ·
CaseyYangMSFT-4714 avatar image
0 Votes"
CaseyYangMSFT-4714 answered SyedMuazzamAhmed commented

Hi @SyedMuazzamAhmed-0521

Per my test, when users don’t have permission to the documents library, they don’t have permission to read the data about csv file in the document library. And there is no other workaround to solve this problem.


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SyedMuazzamAhmed-0521

I'm checking how the things are going on about this issue. Is there any progress on this issue?

0 Votes 0 ·

Hi @CaseyYangMSFT-4714 ,

Sorry, I did not get any email notifications regarding your replies so could not respond to it.

I found 2 work arounds and I am using both of them for different sets of users.

1) First workaround is setting 'Restricted Read' as permission level of the User. With this users cannot access documents library but the CEWP easily reads the files within it and renders on site page when those users open it. The issue with this solution is it stops the user from accessing other files too which I want them to be able to open.

2) The second solution is adding a script snippet in my MasterPage which redirects the user to home page of the SharePoint Site if the User tries to access specific files. The Code reads permission level of the user, and then matches the current URL of the page to the URL of the document I want to restrict. It redirects the user to homepage site if the URL is that of the document.

Hope what I wrote is intelligible 😅

0 Votes 0 ·