Is there a way to publish Razor syntax and (custom) helpers for people, but tell me ... don't let them create blocks of code or restrict them to only using helpers and not give them the power to execute pure C # code in views?
Any ideas and pointers to such solutions are welcome!
update: // I would like to give users the opportunity to write their own HTML code and access only the list of html helpers. Mostly the default and the ones I create.
For example, I do not want them to be able to execute the code inside the block @{ //code }, and also there usingand @model(not sure about this) only have access to@Html.* @if else for foreach
or better yet, give them access only to specific namespaces (this is just a tho thought)
Update: // After some testing, I found out what RazorEngine does as close as possible to what I'm trying to do: run the views in an isolated environment and add access to certain namespaces.
source
share