How to prevent simple users from breaking a page with a script?

Version 2.1 by Vincent Massol on 2025/05/21

Any page with a script requires that the last author of that page has script rights so that the script can be executed.

Thus if a user without script rights modifies that page, the script that was previously executing will stop functioning.

There are 2 solutions to work around this issue:

  1. By using the display macro to include the page with the script.
  2. By putting the script in a wiki macro that exposes a safe way to use the script. Macros require script (and wiki admin) right to be defined, but they don't require any rights to be used. Of course, you need to make sure that all wiki macros that you're creating are safe in the sense that they don't expose dangerous features and that they don't, e.g., evaluate code from parameters or content.

Get Connected