Forum Discussion
Wee Chong Ong
Sep 14, 2018Copper Contributor
Error in Generating HTML Snippet for SPFX Webpart
I have coded a webpart using SPFx framework (React), and am trying to add the webpart into the page layout to avoid any changes by the users. The site is using Classic Experience, and I have coded th...
Wee Chong Ong
Copper Contributor
Hi Joel Rodrigues,
The page has many components and we will want to only allow the user to edit the wysiwyg editor, and as such we can't just restrict the permission at the page/site level.
Will you have any idea if SPFx webpart can be added into a page layout/master page with the use of Design Manager?
Sep 14, 2018
Not that I'm aware of, but an alternative option could be perhaps to only render the webpart to certain users when the page is on edit mode. You can detect this within the webpart code, and add something to the render method that only display a message telling the user that they can't Edit the web part, or not display anything at all.
This way you would not be breaking best practices for customisations
Hope this help
This way you would not be breaking best practices for customisations
Hope this help
- Wee Chong OngSep 17, 2018Copper Contributor
That won't work too, as users will be able to delete the webpart when they are editing the page.