Contents
How does the folder hierarchy work in SPFX?
The Document Library will have a folder hierarchy which must be strictly controlled by the application. When a customer creates a new item in one list (via a UI in an SPFx Web Part – they won’t access the list directly), the system should create appropriate folders in the folder hierarchy.
Can a document library be deployed in a SPFX application?
I have a site which will have a number of Lists and a Document Library deployed as part of an SPFx application. The Document Library will have a folder hierarchy which must be strictly controlled by the application.
After lots of looking around, via Stack Overflow, the various SharePoint GitHub repositories, the SharePoint UserVoice page and many (many!) hours of Googling, it appears that what I’m trying to do with SPFx is not possible. There were several ways to achieve this with SharePoint on-prem, but SPFx seems to be significantly deficient in this area.
How to create sub folders in lists programmatically?
Alternatively you can use relative path API as well. This works well to create sub folder recursively. Thanks for contributing an answer to SharePoint Stack Exchange! Please be sure to answer the question.
How to break inheritance and Remove Item level permission?
Once the permission inheritance is broken, you can add/remove users to the document. Here is how: Navigate to the library and select the document that requires permissions to be changed. Select the Shared With option on the Files tab of the ribbon, In the Shared With page, Click on Advanced option.
This means that it no longer inherits permissions from its parent. For example, you may only want a specific subset of users to access a certain subsite. In this case, you would break permissions inheritance and set a higher necessary level. In this case, all the children of this item will follow this new inheritance.